Tuesday, 6 July 2010

VS2008: Request for System.Web.AspNetHostingPermission failed

Scenario: I've got a lovely new Windows 7 machine at work, so I'm setting it up with Visual Studio 2008 and the SQL Server 2008 Management Tools.

All goes pretty well, until I come to do my first compile of one of our projects. Which fails to build with the error message

Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Off to Google I go, and discover in Pepepe's post here dated 09-04-2007, 11:29 AM that I'm getting the error because my project files are on a remote server rather than locally, and I need to change the permissions on my local Intranet settings. Suddenly the warning I blithely clicked through when I first loaded the project, that the project would not run with full trust, comes back to me :)

Job done? Not quite.

Because, you see, I haven't GOT the Microsoft .NET Framework 2.0 Configuration tool in my Administrative Tools. That comes as part of the .Net Framework 2.0 SDK which you can download from Microsoft here.

So that's another download and install, and the problem is solved. So hopefully,as ever with these arcane 'HowTo' posts, I've gone through that pain so you won't have to ...

0 comments: