I have an ASP.NET MVC 2 app that I have just deployed to IIS7. The app works fine except all static content (js, css, images) are returning blank.

I have the static content handler configured above the MVC handler.

I have looked in the IIS logs and for the static content a HTTP 302 status is returned, but I still can't see them on my page.

Any ideas? Anything else I can check or try?

  • I currently have this successfully deployed on IIS6, so I am thinking it must be something in the configuration of IIS7. – Jon Dec 15 '10 at 2:04

Based on your comment that you have the static file handler above the MVC hander, it sounds like you have it set correctly.

Just as an extra double check, go to server manager, roles and IIS, make sure that you have necessary features added to IIS. That really just adds it to applicationHost.config, but it serves as a double check. That will ensure that the modules, handlers and globalmodules are installed and enabled.

  • Thanks, I just checked the features and they are all installed :( – Jon Dec 15 '10 at 2:48
  • This still seems like the most likely cause for me. How about from Server Manager, removing static pages, applying and then adding it back again. That will refresh the settings. Consider doing that for a number of the settings. In fact, if you don't have any unique settings that you don't mind losing, try a full reinstall. That will give you a fresh applicationHost.config again. Another test is to try a new website with a simple hello world in it. That will confirm if it's server level or something with your site or site configuration. – Scott Forsyth - MVP Dec 15 '10 at 16:01

I found the issue - I should have gone with my first thought when I had it - I ran ProcMon and found that it was getting an Access Denied on my static content directory.

However the user trying to access it was IUSR, NOT NetworkService (as the App Pool is set up to run under). This must be an IIS7 thing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.