5

I've pointed my local IIS 7 to my local ASP.Net MVC project and everything is working fine except for the static content. Going to http://localhost:8080/Content/Site.css gives me a 404. I can see the folder on IIS Manager.

Any ideas what might be wrong?

masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Pablo Fernandez
  • 7,438
  • 25
  • 71
  • 83

3 Answers3

4

The problem was permissions. Even though when I create the IIS7 web site I told it to access the files as my user (it wouldn't work at all otherwise), for static file it was using the user of the application pool. Giving access to IIS APPPOOL\MyApplication to the folder where my project was fixed the issue.

Pablo Fernandez
  • 7,438
  • 25
  • 71
  • 83
  • What's the location of the `Contents` folder? Like `c:/...` Is it the location where your project is or is it in some IIS folder? – Jo Smo Oct 26 '15 at 10:48
2

I had to take the additional step of adding read permissions to the IUSR account as detailed in this post: http://forums.iis.net/t/1175217.aspx

Jason
  • 247
  • 2
  • 9
0

Check your event logs and see if anything is getting spewed out there. It might give you more details about what the problem is.

Eppz
  • 121
  • 2