I was wondering if anybody were able to run an MVC 5 application on a hosting company that restrict code access security to medium. I developped my app locally with the default settings (Full trust) but when deploying on the hosting company (whois.com) I am getting :
[FileLoadException: Could not load file or assembly 'App_global.asax.tlpxeipo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. PolicyException thrown. (Exception from HRESULT: 0x80131416)]
After email tech support, they informed me that they are restricting Code Access to medium; they advised to add:
<trust level="Medium" />
in my webconfig and figure out how to get it to work and then redeploy (not very helpful).
I've done some research, some posts are saying that MVC 5 app will not run unless trust is set to Full. I also found that I might be able to solve the issue using the AllowPartiallyTrustedCallersAttribute Class, but unsuccessful so far. Also to note the exception is thrown on loading the global.asax file.
Has anyone been successful in fixing this problem? I'm considering either changing hosting company or rewriting the app with MVC 4 at this point (not even sure if I would not run into the same problem though)
Any advices or help would be mostly welcome.
As mentioned by Stephen, MVC5 does not support partial trust. When shopping for a hosting company, make sure you confirm that their servers are allowing Full trust. I spent considerable time to find a work around and no luck. Not worth the time, get hosting company that provide Full trust.
User contributions licensed under CC BY-SA 3.0