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

Jan 20, 2009 at 2:04 PM
Edited Jan 20, 2009 at 2:49 PM
I just downloaded the MetaBuilders WebControls, unzipped, added the .dll to the Visual Studio 2008 Toolbox, then drag-n-dropped the ComboBox control on my .aspx page. Now I recieve the following error during runtime: 

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

The .aspx page looks like this:

<%

@ Register Assembly="MetaBuilders.WebControls" Namespace="MetaBuilders.WebControls" TagPrefix="mb" %>

 <mb:combobox runat="server"></mb:combobox>

It appears to have registered correctly and I don't have any red-squigglys appearing under its code...

Help.

PROBLEM SOLVED!!!

http://weblogs.asp.net/jgaylord/archive/2007/02/13/system-web-aspnethostingpermission-when-accessing-network-or-intranet-projects-using-visual-studio-2005.aspx

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

 

<system.web>
<trust level=

"Full" originUrl="" />

However, since
this is only in development, I can change my local PC security by going to:

 

1

 

. Start > Control Panel > Administrative Tools > Microsoft .NET Framework 2.0 Configuration.
2. Fully expand My Computer in the navigation tree
3 Click Runtime Security Policy.
4. Choose Adjust Zone Security. (right-hand pane)
5. Leave the default option (Make changes to this computer) and hit Next.
6. Choose Local Intranet and change the trust level to Full Trust.
7. Then choose next and then finish.
8. Restart Visual Studio 2005 and you should be all set.

 

 

Don't forget to RESTART Visual Studio...

Cheers...