Windows 7 x64 and IIS 7.5: AspNetHostingPermission Error
Quick Fix
I’m running Windows 7 Ultimate x64 on my laptop. I was setting up a downloaded code sample from the inimitable Rick Strahl and got this:
Exception Details: System.Security.SecurityException: Request for the permission of type ‘System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed.
After much Googling, discovered this:

If that setting is blank, it’s trying to use “pass-through credentials,” which I assume is Anonymous access. I tried to get anonymous working by adding the IUSR account to that folder, but no luck. Obviously this isn’t the way you’d set things up in production but it works for my dev machine. Hope this saves someone some time.
Categories: Windows
iis7.5, visualstudio, windows7


You can also try changing the application pool identity to “Network service” – That did the trick for me.
I think I tried that with no luck, I’ll have to try it again next time I set up a website…
I tried Matt’s fix, and that worked. I was struggling to get Telerik to run and his fix did the trick.
THANK YOU! Thank you so much dswersky and Matt. You guys saved me hours and hours of pain and suffering.