ASP.Net MVC JS/CSS bundling not working when deployed

Shane Courtrille picture Shane Courtrille · Mar 5, 2012 · Viewed 9.3k times · Source

I've deployed a small web app which was written in ASP.Net MVC 4. We have our JS/CSS bundles setup properly and they work fine locally. The problem is when I deploy to an IIS 6 server the bundles don't seem to work. The js/css doesn't download and when I try to go to the js link in the script I get a 404.

Has anyone deployed MVC 4 to IIS 6 and had this work?

Answer

Shane Courtrille picture Shane Courtrille · Mar 5, 2012

The problem was that we were running as a Virtual Directory configured for ASP.Net 4.0 under a Default Web Site which was configured for ASP.Net 2.0.

We created a new web site and set it to asp.net 4.0 and everything worked perfectly. As per this post on Haacked extensionless urls should just work on most instances of IIS 6 now.