views:

292

answers:

3

Trying to get an ASP application deployed; it worked for a while but then started coming up with errors whenever the page is accessed:

Server Error in '/AppNameHere' Application.

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

An IISreset didn't change anything, but rebooting teh entire system got it to work for a few hours before the problem came back. The .config for the application is set to full trust.

What could be causing this, and how can it be fixed? (Or, if more information is needed, where do I go looking to find it)

+1  A: 

This link may be of help:

http://forums.asp.net/t/909639.aspx

Georg Zimmer
+2  A: 

Found the following on Jason Gaylord's blog:

System.Web.AspNetHostingPermission when Accessing Network or Intranet Projects using Visual Studio 2005

I rebuilt one of my development machines recently and attempted to access a project that I had out on a network share. I continually received project messages about the project not being trusted. I remembered that I had to change something but couldn't remember what it was until I found an old note I left in Outlook.

The message I would receive in Visual Studio 2005 was: ASP.NET runtime error: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

To resolve this issue, you must change your development machine .net security configuration since you are accessing items across the network. In the event that you need this ability at runtime, you must change the trust level in your config file to full. However, since this is only in development,

  1. I can change my local PC's security by going to Start > Control Panel > Administrative Tools > Microsoft .NET Framework 2.0 Configuration.

  2. After it fully loads (sometimes takes a bit), fully expand My Computer in the navigation tree and click Runtime Security Policy.

  3. In the right hand pane, choose Adjust Zone Security. Leave the default option (Make changes to this computer) and hit next.

  4. Choose Local Intranet and change the trust level to Full Trust. Then choose next and then finish.

  5. Restart Visual Studio 2005 and you should be all set.

This worked for me ... so hopefully this will work for you!

mattruma
A: 

I apologize up front that this is a question not an answer, but I have the same problem on Windows 2008.

Where has Microsoft hidden the 'Microsoft .NET Framework 2.0 Configuration' tool?

Mark Arnott