IIS 7.5 and Razor Site: 500 errors for CSS and JS

Brian Mains picture Brian Mains · Mar 29, 2012 · Viewed 12.4k times · Source

For some reason, when I deploy my Razor MVC web site to my Windows 2008 R2 server, I'm getting 500 internal server errors for all CSS and JS. I'm not sure why, because I've done the following:

  • Enabled static content in IIS
  • Enabled anonymous access, with the default ID being the application pool identity and given that identity read/write permission to the folders
  • Ensured my static content handler was setup correctly

What other problems could it be? How can I even debug this to see what the actual error is? Even though I have an Application_Error handler, nothing is getting logged. And IIS logs doesn't give me the error info?

Thanks.

Answer

Tony picture Tony · Aug 12, 2013

Mime-Types were my trouble

I had the same problem. My css and js was not delivered. Server says internal error.

I found out that i added the mimetype for mp4 in the global settings of the iis and also added the mime type in one of my websites as well. That was a problem. This mime-type can only exist in the website or global, not both. I deleted tehe global mimetype and everything worked like it should be.

Hope to help some guys of you.