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

17

I created a blank MVC 3 application on VS2010 SP1, and set the app to use IIS Express. When I debug, I get error 500.0 (0x80070585)

I am able to succesfuly run the app using the VS dev server

I have set the app directory to Full Permissions for Everyone, just to eliminate all possibility of security issues. I have further verified that IIS express is able to hit the web.config by confirming it using SysInternals ProcMon. ProcMon does not show the IISExpress process attempting to read from any other files in my application directory.

I have followed the suggestions in the following question, but it does not give me any better information. HTTP 500 Internal Error - IIS websites

No logs are generated in the IISExpress directory in either the Logs or TraceLogs directory, but a log is created in Temp, however it is not very useful.

Successfully registered URL "http://localhost:62017/" for site "MvcApplication1" application "/"
Registration completed for site "MvcApplication1"
Request ended: http://localhost:62017/ with HTTP status 500.0
Request ended: http://localhost:62017/ with HTTP status 500.0
Request ended: http://localhost:62017/ with HTTP status 500.0

There are no messages I am able to find in the Event Viewer

**Updates : ** Disabled firewall, no change Ran IISExpress via command line, no change

visual-studio-2010
iis-express
asked on Stack Overflow Jun 20, 2012 by Jason Coyne • edited May 23, 2017 by Community

8 Answers

15

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
answered on Stack Overflow Jul 5, 2012 by theforce
14

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>

....
...
..
.
answered on Stack Overflow Jun 25, 2014 by uzay95
5

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

answered on Stack Overflow Apr 14, 2014 by Aaron Hoffman • edited Mar 31, 2017 by Aaron Hoffman
4

reinstalling iis express appears to have resolved this problem

answered on Stack Overflow Jun 29, 2012 by Jason Coyne
1

Are you using any PLINQ(.AsParallel) or Parallel.For or similar methods? I've found that the AggregateExceptions they throw aren't handled well by MVC (In my case, I got a blank 500 page and nothing in Logs/Event logs).

I identified the problem by paying attention to the "First Chance" exceptions which are logged in the Debug output window in VS. Try running the site, waiting for it to error, clearing the Debug window and the reloading the page. Do you see anything useful?

answered on Stack Overflow Jun 27, 2012 by Basic
1

There might be a problem with your config files, specifically web.config and applicationhost.config.

The only way I know how to diagnose this, is to publish a build to regular IIS, and in IIS Manager check the "Error Pages" module of the Site. If it is indeed an issue with those config files, you'll get a popup here with something along the lines: "Cannot add duplicate entry of type …". Google accordingly.
If the "duplicate entry" is of type "error", you can try adding the following element below httpErrors:

<remove statusCode="404"/>

That is, assuming you have an Error element below the HttpErrors with statusCode 404. (I had once.)

answered on Stack Overflow Oct 17, 2018 by Protector one
0

In my case the issue was caused by using windows authentication + firefox + wrong domain login with insufficient permissions.

Details: My dev machine is using windows domain "domA", the application will run in an environment accepting logins from domain "domA" and "domB". While on the webserver both will work, on my dev machine only my account in "domA" has sufficient permissions to access all files of the application. In IE "domA" is used by default while in FF I get a login dialog where I did login with my account from "domB".

Confusing issue I know, but maybe there is someone else having the same situation. At least it will help me the next time I run into it. :)

answered on Stack Overflow Nov 20, 2019 by Wowe
0

Just in case catches someone else out, I had similar error but the issue was I had updated my web.config and there was an extra ">" character where it should be.. so malformed web.config file can cause the same behaviour.

answered on Stack Overflow Jan 11, 2021 by user2128898

User contributions licensed under CC BY-SA 3.0