Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Request for the permission of type 'System.Web.AspNetHostingPermission"

I am facing a problem for running my website.

I have developed the website and when i hit F5 to view the results i am presented with this error

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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Error Page

How can i solve this problem.

like image 270
MARKAND Bhatt Avatar asked Nov 28 '12 11:11

MARKAND Bhatt


3 Answers

This error usually happens if you Map your application folder on Network Drive or open Solution file from UNC Path. somthing like this:

Invalid Example: \\my-server\my-project

Try to open your solution from direct path

Valid Example: C:\Project\MyProject

You can also make change to your privilege of App Pool Identity but it's not recommanded:

Web Server (IIS) > App Pool Identity > Advance Settings > Set Identity as Network Service

like image 94
akokani Avatar answered Nov 14 '22 04:11

akokani


the one shot solution worked for me was to set the App Pool Identity(Advance Settings) to Network Service

like image 20
donstack Avatar answered Nov 14 '22 04:11

donstack


Try to set "Load User Profile" value of your application pool to "True". It worked for me.

like image 6
RSB Avatar answered Nov 14 '22 03:11

RSB