What application trust level is need for ASP.NET MVC framework?
Asked Answered
S

3

7

i am trying to deploy simple asp.net mvc frameworkd application in may shared hosting and i get erro like this:

Security 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.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
http://test.pakabink.lt/

In my control panel i am seting "ASP.NET 2.0 Full Trust". What i need to ask for server administrator to change?

Sextuple answered 26/4, 2009 at 19:55 Comment(1)
I am also getting this error while deploying to a medium trust hosting (GoDaddy) using StructureMap. I'm currently looking for a solution as well.Rockribbed
C
4

You should be able to bin deploy and run the MVC framework in medium trust. There is a possibility that there is some other permission that the hosting company has taken away but it should work. Are you testing with the default MVC project? If you are using other components (Structure Map, for example), that may be causing the error.

Check out Bin Deploying ASP.NET MVC from Phil Haack about deploying and the required trust level.

Chaudoin answered 26/4, 2009 at 20:33 Comment(0)
B
0

Medium trust does not allow certain Reflection operations. I guess some part of your code does or calls other part(s) of code.

Bellyful answered 27/4, 2009 at 22:35 Comment(0)
A
0

Web deploy copies some System.Web dlls to bin folder, for example System.web.MVC but not all. It is kind of lot of debugging to determine which ones are missing, like the previous comment said about reflection methods.

Aubree answered 11/8, 2016 at 15:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.