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

Posted by: Jason N. Gaylords Blog, on 13 Feb 2007 | View original | NEW Bookmarked: 0 time(s)

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, I can change my local PC's security by going to Start > Control Panel > Administrative Tools > Microsoft .NET Framework 2.0 Configuration. After it fully loads (sometimes takes a bit), fully expand My Computer in the navigation tree and click Runtime Security Policy. In the right hand pane, choose Adjust Zone Security. Leave the default option (Make changes to this computer) and hit next. Choose Local Intranet and change the trust level to Full Trust. Then choose next and then finish. Restart Visual Studio 2005 and you should be all set.

Advertisement
Category: Security | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 3835 | Hits: 33

Similar Posts

  • Announcing Microsoft Ajax Library (Preview 6) and the Microsoft Ajax Minifier more
  • Silverlight SVC Web Service problems on IIS more
  • ASP.NET Podcast Show #133 - Windows Azure Table Storage - video more
  • Creating Extension Methods in VB more
  • SQL 2008 CLR Triggers, use a .NET class library in SQL using WPF more
  • Open SQL Port for specific IP by ASP.NET Website more
  • Creating Extension Methods in VB more
  • Intersoft WebUI Studio 2008 R2 SP1 is Now Available more
  • ASP.NET Podcast Show #125 - Routing with Webforms more
  • Web.UI Navigation Controls and Web Services more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD