只是尝试设置 ASP.NET MVC 的开发环境,启动了一个空白的 ASP.NET MVC 项目,并将以下内容放入我的 web.config 中: <trust level="Medium" originUrl=""/>
运行该项目会导致以下异常:
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.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
如果可能,我想开发中等信任度的应用程序,因为我无法选择将其托管在何处,并且信任级别可能存在某种限制。
最佳答案
当前版本的ASP.NET MVC仅支持<trust level="Full" />
- 引用this answer
关于c# - 中等信任度的 ASP.NET MVC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/861251/