System.Security.SecurityException抛出由ASP.NET应用程序 [英] System.Security.SecurityException thrown by ASP.NET application

查看:223
本文介绍了System.Security.SecurityException抛出由ASP.NET应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图让部署的ASP应用程序;它工作了一段时间,但随后开始想出错误时的页面被访问:

Trying to get an ASP application deployed; it worked for a while but then started coming up with errors whenever the page is accessed:

安全例外说明:该应用程序试图执行
  操作不是由安全策略不允许的。要授予此
  应用程序所需的权限,请联系您的系统
  管理员或更改应用程序的信任级别
  配置文件。

Server Error in '/AppNameHere' Application.

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

异常详细信息:System.Security.SecurityException:请求
  权限类型的System.Web.AspNetHostingPermission,系统,
  版本= 2.0.0.0,文化=中性公钥= b77a5c561934e089'
  失败了。

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

这是IISRESET没有任何改变,但重启整个系统得到了它的几个小时前的工作问题又回来了。在的.config 应用程序设置为完全信任。

An IISreset didn't change anything, but rebooting the entire system got it to work for a few hours before the problem came back. The .config for the application is set to full trust.

什么可能会造成这一点,怎么能解决吗? (或者,如果需要更多的信息,我在哪里去寻找找到它)

What could be causing this, and how can it be fixed? (Or, if more information is needed, where do I go looking to find it)

推荐答案

上找到<一以下href=\"http://weblogs.asp.net/jgaylord/archive/2007/02/13/system-web-aspnethostingpermission-when-accessing-network-or-intranet-projects-using-visual-studio-2005.aspx\"相对=nofollow>贾森盖洛德的博客:

System.Web.AspNetHostingPermission使用访问网络或Intranet项目时,Visual Studio 2005中

我最近重建我的开发机器之一,并试图访问一个项目,我不得不出去在网络共享上。我不断收到关于不被信任的工程项目的消息。我记得我不得不改变的东西,但不记得这是什么,直到我发现了一个旧注我离开了在Outlook中。

I rebuilt one of my development machines recently and attempted to access a project that I had out on a network share. I continually received project messages about the project not being trusted. I remembered that I had to change something but couldn't remember what it was until I found an old note I left in Outlook.

我会接受在Visual Studio 2005中的信息是:ASP.NET运行时错误:请求类型的权限'System.Web.AspNetHostingPermission,系统,版本= 2.0.0.0,文化=中性公钥= b77a5c561934e089'失败

The message I would receive in Visual Studio 2005 was: ASP.NET runtime error: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

要解决此问题,必须因为你正在访问整个网络的项目改变你的开发机器的.NET安全配置。在你需要这种能力在运行时,你必须改变你的配置文件,以充分的信任级别。然而,由于这仅是在发展中,

To resolve this issue, you must change your development machine .net security configuration since you are accessing items across the network. In the event that you need this ability at runtime, you must change the trust level in your config file to full. However, since this is only in development,


  1. 我可以改变我的本地PC的安全
    从开始>控制面板>
    管理工具>微软
    .NET Framework 2.0配置。

  1. I can change my local PC's security by going to Start > Control Panel > Administrative Tools > Microsoft .NET Framework 2.0 Configuration.

它全部加载(有时后
需要多一点),全面拓展我的
电脑在导航树
单击运行库安全策略。

After it fully loads (sometimes takes a bit), fully expand My Computer in the navigation tree and click Runtime Security Policy.

在右侧窗格中,选择
    调整区域安全。离开
    默认选项(更改本
    电脑),并点击下一步。

In the right hand pane, choose Adjust Zone Security. Leave the default option (Make changes to this computer) and hit next.

选择本地Intranet和更改
    信任级别设置为完全可信。然后
    选择下一步,然后完成。

Choose Local Intranet and change the trust level to Full Trust. Then choose next and then finish.

重新启动Visual Studio 2005和您
    应该准备就绪。

Restart Visual Studio 2005 and you should be all set.

这为我工作......所以希望这会为你工作!

这篇关于System.Security.SecurityException抛出由ASP.NET应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆