Why am I getting error 500.0 in when using IIS Express (significant debug info included)

I had the same issue last week, the app running perfect in dev web server from VS Studio. But in IISExpress anytime HTTP Error 500. My solution on this time was:

  • close VS Studio - solution set with IISExpress
  • got to: /Document/IISExpress/config/ in your profile
  • rename or delete applicationhost.config
  • open your solution in VS Studio
  • a Dialog will fire up from IISExpress - this will set a fresh config.
  • try to run your web app

You may have some mime code in the Web.Config file like this:

<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />

if so, you should remove mimeMap before adding like this:

.
..
...
....
  </system.web>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".svg" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
    </staticContent>
  </system.webServer>

....
...
..
.

This may be related to a conflict between the IIS Express applicationhost.config and your web.config.

A mimeType was added to my local web.config that was already present in the applicationhost.config and IIS Express started serving many 500 errors.

You may also notice this error in your Windows Event Log, "The directory specified for caching compressed content is invalid. Static compression is being disabled."

More info: http://blog.degree.no/2013/04/the-directory-specified-for-caching-compressed-content-is-invalid-static-compression-is-being-disabled/

I removed the mimeTypes from the web.config and the issue was resolved.

applicationhost.config location: C:\Users\[User]\Documents\IISExpress\config