当我尝试在本地运行我的网站时,我收到此错误: 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.它与应用程序池设置“加载用户配置文件=真”有关.