C# – ASP.NET MVC in Medium Trust

asp.net-mvccmedium-trust

just trying to set up my development environment for ASP.NET MVC, have started a blank ASP.NET MVC project, and have placed the following in my web.config: <trust level="Medium" originUrl=""/>

Running the project then results in the following 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.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

If possible, I want to develop my app for medium trust, as I don't have a choice where it will be hosted, and the possibility exists that there may be some sort of restrictions with the trust levels.

Best Answer

The current version of ASP.NET MVC only support <trust level="Full" /> - refer this answer

Related Topic