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.

5 Responses to Windows 7 x64 and IIS 7.5: AspNetHostingPermission Error

  1. Matt says:

    You can also try changing the application pool identity to “Network service” – That did the trick for me.

  2. I tried Matt’s fix, and that worked. I was struggling to get Telerik to run and his fix did the trick.

  3. Amit says:

    THANK YOU! Thank you so much dswersky and Matt. You guys saved me hours and hours of pain and suffering.

  4. Ginom says:

    Useful article. Translated several articles on IIS on Russian and placed them on his blog Ginom Home.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.