Running a asp.net web application project on IIS7 throws exception

I just converted a website to a web application project and I am getting this error:

System.Security.SecurityException: Request for the permission of type 
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Any ideas? Everything else runs fine on IIS7. The application requires full trust, and I have that set in the web.config. Do I need to give it full trust access somewhere in IIS?

Thanks!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I think the missing secret sauce is to go into the Application Pool defaults and set Load User Profile = True

Method 2

Looks like permissions on the website root folder. Are the IIS7 worker processes configured correctly?

Method 3

FullTrust need to be given by the Administrator. You can not attain FullTrust to your ASP.NET application by just setting so in Web.Config. The Admin. will need to do this in IIS Manager.

Thanks.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x