Display Images with IIS7 in Vista or Windows 2008

So, this may seem simple, but for an hour I wrestled with displaying images on IIS7 with vista.  ASP.NET worked fine, but no static files, css, jpg’s, gif’s or anything.  Just unformatted text.

Turns out when I added the web server in vista, I forgot to check the Static Content checkbox under World Wide Web Services / Common Http Features.

Hope this finds you if you are having the same problem.


About Peter Kellner

Follow me:


  1. I had a similar issue with a web site on WS2K8R2 located in an alternate/non-standard location. Instead of my site files being located under C:\inetpub\wwwroot I had the audacity to place them under D:\Content and had the same symptoms as described above: no static images and no CSS. After hours of head scratching I tried moving my site under wwwroot – and it worked! I then realized that the security settings for D:\Content had to include read access for SERVERNAME\Users (in addition to IIS_IUSRS) after which my static issues disappeared.

    I have not seen this written up anywhere, and the IIS logging is next to useless for debugging this kind of problem, generating thousands of lines of cruft.

  2. I’m facing a different problem, images are displayed but every time when I refresh the page or open fresh session of the website some images are appeared corrupted for example if you go to tagmobile.com you can find this problem. If I host the same website in some other server then, the images appearing fine. SO this can’t image or coding issue.

    Please help.

  3. thanks for your help

  4. Nice suggestion… Many people forget to check the Static Content checkbox…

  5. where in web.config should add “name=”StaticFile” path=”*” verb=”*” modules=”StaticFileModule,DefaultDocumentModule,DirectoryListingModule” resourceType=”Either” requireAccess=”Read”” be added?


  7. Thanks you very much Peter, you are a legend.

  8. Thank you!

  9. dominique says:

    You are officially my hero!!!!!


  11. add name=”StaticFile” path=”*” verb=”*” modules=”StaticFileModule,DefaultDocumentModule,DirectoryListingModule” resourceType=”Either” requireAccess=”Read”

  12. @Irfan: try amending/adding the following to your web.config section…

  13. Thanks PRO very much.

  14. Still not working for me, everything is enabled and the images are not showing , any other suggestion ?

  15. Irfan Shahid says:

    I am still stuck with the issue, the static content is installed. the website is not showing only text boxes and nothing else. javascript and css is not being rendered. any tip in this regard?

  16. Thanks a lot, it helped.

  17. Azam Zia says:

    Thanks, my expert friend was stuck on it for hours.

  18. Francisco Leon says:

    OMG, this is just what I needed thanks a lot, I spent a whole day of work figuring out if it was my forms authentication or what.


  19. This does not work on IIS7.5?

    I am still stuck on the stage that static content is not rendered through pages.

    I have enabled Static Content through the turn features on/off, but still I cannot get to properly render pages, as it is missing image files, stylesheets and related…

    The weird part is that, if I open the standard IIS start page:

    http://localhost (works fine – images and styles and related are properly rendered)

    http://servername (works fine – images and styles and related are properly rendered; this is on the server and lan clients)

    http://publicip (does not render images, styles and related – this was tested from external network)

    for some reason my page does exaclty the same as yours did, I can render html pages, or aspx pages, but none of the images or static content is render

    any help would be much appreciated! thanks

  20. vishal gondil says:

    thanks …………….
    really good solution……………

  21. Thank you from Dallas,TX! I had been looking for a couple of hours for the solution of this same problem in Windows 7. Thanks again!

  22. Great info dude…

    Just like Mitch, I’ve been wasting my time to look around….even on the MSDN sites.

    Thank u very much…

  23. Forgot to say thanks!

  24. Awesome! I spent hours surfing the web trying to figure this out, finding multiple forums where someone would have the same problem, then eventually end the thread with “Solved it, thanks” and not post the answer. Funny how a night’s rest and a new search comes up with the answer almost right away.

  25. Thank you. This is what I needed.
    Funny that “common features” are not enabled by default.

  26. Nice suggestion… Many people forget to check the Static Content checkbox…

  27. Thanks for the tip, this was really getting on my nerves.

  28. Thanks for the tip! Saved me some time. For other non-Vista users like myself, here’s how you find that dialog:

    Click Start -> Control Panel -> Programs and Features -> Turn Windows features on or off

    Then drill down into IIS as shown in the image above.



  29. Shahmir Noorani says:

    Good find m8. Thanks for the help.


Get every new post delivered to your Inbox

Join other followers: