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=22.214.171.124, 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!