Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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

2 Answers 2

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.

share|improve this answer
    
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?

share|improve this answer
    
The IUSR is the default account for anonymous authentication. You can change that, look here: iis.net/ConfigReference/system.webServer/security/… –  Somantra Jun 23 '12 at 12:06
    
Static content handler impersonates IUSR by default, you can set it to the application pool identity by editing the property. –  Wyatt Barnett Jun 23 '12 at 14:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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