Gavin
Gavin

Reputation: 17402

ASP.Net MVC & Local IIS Issue Loading Stylesheets

I have an ASP.Net MVC 3 application that runs fine when I use the visual studio web server.

However if I change the project to use IIS the application runs but its fails to retrieve any script or stylesheet files, if I use the chrome developer tools it is retrieving them but they have a file size of 0kb.

They are the standard references that come with the default Razor MVC 3 project

Any ideas what in my local IIS is causing these files to come back blank? even if I browse to http://localhost/myproject/content/Site.css I still get a blank file and no errors server side.

I'm using Windows 7 and IIS 7 if that helps.

Upvotes: 2

Views: 2515

Answers (1)

Gavin
Gavin

Reputation: 17402

Found the problem, when I installed IIS I didn't tick the "Static Content" box under

Internet Information Services\World Wide Web Services\Common HTTP Features

I went back in to Turn windows features on or off, ticked this box and now it works.

Upvotes: 10

Related Questions