Request for the permission of type 'System.Web.AspNetHostingPermission' failed when compiling web si
- by ahsteele
I have been using Windows 7 for a while but have not had to work with a particular legacy intranet application since my upgrade. Unfortunately, this application is setup as an ASP.NET Website project hosted on a remote server. When I have the website open in Visual Studio 2008 and try to debug it I get the following compiler error:
Request for the permission of type 'System.Web.AspNetHostingPermission' failed
To resolve this issue on Windows Vista machines, I would change the machine's .NET Security Configuration trust level to full for the local intranet (fix outlined here). I believe this configuration utility relied upon the mscorcfg.msc which from some cursory research appears to be apart of the .NET 2.0 SDK. I have tried to follow the instructions from this Microsoft Support article running the command below to no avail.
Drive:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url
"file:////\\computername\sharename\*" FullTrust -exclusive on
Presently, I have the following .NET and ASP.NET components installed on my machine
Microsoft .NET Compact Framework 2.0 SP2
Microsoft .NET Compact Framework 3.5
Microsoft .NET Framework 4 Client Profile
Microsoft .NET Framework 4 Extended
Microsoft .NET Framework 4 Multi-Targeting Pack
Microsoft ASP.NET MVC 1.0
Microsoft ASP.NET MVC 2
Microsoft ASP.NET MVC 2 - Visual Studio 2008 Tools
Microsoft ASP.NET MVC 2 - Visual Studio 2010 Tools
Do I need to install the .NET 2.0 SDK? Am I issuing the caspol command incorrectly? Is there something else that I am missing?