Iis – Unable to run ASP.NET web application in MEDIUM trust level

asp.netiis

I developed an Web Application and published it on my Shared Hosting. After that I am receiving following error-

enter image description here

To resolve it, I contacted my hosting providers and they told me to set my application to run in Medium Trust and to contact with my developer (that is me this case :P).

Now, I added <trust level="Medium" /> in my web.config file and it is not even running on my local machine now.

After many research I thought to test this feature with brand new project-

  1. Created a brand new ASP.NET MVC project and set trust level to Medium. (No success)
  2. Created another project as empty. Added a default.aspx page and set the trust level to Medium (No success again).

Now I am unsure how to resolve this.
Any help will be much appreciated!

Best Answer

MVC5 does not support medium trust. Either use MVC4 or change trust level to full. There are several posts related to this issue.