当前位置 : 主页 > 网络编程 > ASP >

asp.net – 为什么我收到此错误:System.Security.SecurityException:请求类型’System.W

来源:互联网 收集:自由互联 发布时间:2021-06-24
当我尝试在本地运行我的网站时,我收到此错误: 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
当我尝试在本地运行我的网站时,我收到此错误:

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.

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.

堆栈跟踪:

[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +201
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +302
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +64

我没有运行UNC共享或访问任何共享网络资源.它是在Windows 7机器上的IIS7上运行的.NET 3.5站点.

我不认为在这个开始发生之前我做了任何改变,因为我已经重建了解决方案&重新启动电脑.

试试 following.它与应用程序池设置“加载用户配置文件=真”有关.
网友评论