Dave Burke : Freelance .NET Web Developer specializing in Online Communities

AspNetHostingPermission Security Exception Fix in IIS7

I'm starting to regularly use the excellent ASP.NET Ajax Control Toolkit and had an interesting incident involving the toolkit last week on my home office Windows 2008 server.  Periodically when I loaded an Ajax Toolkit Control on my DBVT development site I would encounter a Security Exception on System.Web.AspNetHostingPermission. 

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

I didn't encounter this with the toolkit on any other site. It would fix itself after touching the web.config, and it was in my development environment after all, but I still had to get to the bottom of it.  I stayed with it during down time over several days, trying various solutions with no success until I found an obscure reference in a DotNetNuke discussion thread.

"One suggestion I found was to change the thread pool to load the profile."

APPLICATION POOL!  Of course!  Whenever something inexplicable occurs, consider the application pool.  Here's a screenpic of the IIS7 Application Pool settings running in Integrated Pipeline Mode.  Set "Load User Profile" to true.



You love me, I know.  You're welcome! 

Comments (4) | Post RSS RSS comment feed

Posted on 6/8/2009 8:05:58 PM by Dave Burke
Categories: .NET
Tags: No tags for this post

Related posts

Comments

6/15/2009 9:53:53 AM Permalink

Thank you very much!
i Just worked on this bug for 3h and now its working because of a simple false>true.

best regards
Christoph

Christoph Schuster Germany |

6/17/2009 6:21:20 PM Permalink

After 2 hours of wading through google hits... Thanks Dave!!!

scott United States |

6/17/2009 8:38:34 PM Permalink

Christoph and Scott,

Thank you so much saying Hey!  I knew this was one of those hard-to-crack issues that rebroadcasting the fix might be helpful.

Best regards,
Dave

daveburke United States |

1/6/2010 3:01:02 AM Permalink

'system.web.aspnethostingpermission' error during install

<p>The following event is logged during the first run of a DNN portal;</p>
<p><strong>System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetH ...

Technical Blog |

Comments are closed

This site was built with the Sueetie .NET Online Community Framework. Learn more about Sueetie at Sueetie.com.