我在Visual Studio 2008中开发了一个Asp.net网站,它在使用Vista操作系统时运行良好,但我的工作站升级到Windows 7,现在出现以下错误:
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.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.
我从Visual Studio中运行本地计算机时遇到此错误…我已经用Google搜索了错误,但到目前为止我找不到任何帮助.部署在服务器上时,我没有收到错误,只是在我的本地.
该网站引用了我在同一解决方案中创建的.dll项目.当我尝试实例化其中任何一个.dll项目中包含的对象时,似乎会发生错误.
Web.config中的此设置没有帮助:
<trust level="Full" originUrl="" />
也没有这样做:
<securityPolicy> <trustLevel name="Full" policyFile="internal" /> </securityPolicy>