c# - 中等信任度的 ASP.NET MVC

标签 c# asp.net-mvc medium-trust

只是尝试设置 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/

相关文章:

asp.net-mvc - 中等信任度下 MVC Controller + 依赖注入(inject) (Ninject) 的问题

c# - 为什么 LINQ to SQL 将 GroupBy 翻译成多个查询

asp.net-mvc - 如何将包含冒号的 GET 请求发送到 ASP.NET MVC2 Controller ?

asp.net - 在 Azure 上托管时无法利用 SIMpleMembership 功能

c# - MVC EnumDropDownListFor 以 Enum Display Description 属性作为值

asp.net - 中等信任度的 LDAP

c# - 中等信任度的匿名类型,与 Reflection 而不是 Expressions 一起工作

c# - "Unable to read data from the transport connection: An existing connection was (NOT FORCIBLY) closed"在 RESTful Web 服务调用上

c# - 在asp.net mvc3图表助手中如何向系列数据添加标记

c# - 使用 C# 生成 XML 文档