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

9

21

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

Glasser answered 20/6, 2012 at 14:52 Comment(0)
G
4

reinstalling iis express appears to have resolved this problem

Glasser answered 29/6, 2012 at 15:11 Comment(0)
H
16

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
Homan answered 5/7, 2012 at 16:16 Comment(4)
I tried these steps myself as well, but it did not work for me. Thanks for the good answer though!Glasser
If you are using Visual Studio 2015, the applicationhost.config is present inside your solution folder. See [this] (https://mcmap.net/q/659558/-why-is-iis-express-returning-http-500-errors-loading-javascript-and-css)Irregular
I had this same issue on VS 2013. This solution worked for me, only after renaming the file and starting VS again, I didn't get a dialog from IISExpress. I just pressed F5 and it worked.Microsecond
It did create a new applicationhost.config file. That's a cool way to ensure that the IIS Express config is reset to the defaults. Sadly that didn't solve my status code 500 problem.Spare
R
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>

....
...
..
.
Recording answered 25/6, 2014 at 9:5 Comment(1)
You are correct - how on earth would you track down something like that?Ganja
G
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

Glacialist answered 14/4, 2014 at 18:2 Comment(0)
G
4

reinstalling iis express appears to have resolved this problem

Glasser answered 29/6, 2012 at 15:11 Comment(0)
N
2

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?

Neisse answered 27/6, 2012 at 20:43 Comment(1)
This error is happening in a blank MVC application, no logic whatsoeverGlasser
A
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.)

Argillaceous answered 17/10, 2018 at 11:52 Comment(1)
I had some seemingly OK changes to the web.config, but reverting these solved the problem.Xylotomous
B
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. :)

Blatant answered 20/11, 2019 at 8:29 Comment(0)
Z
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.

Zecchino answered 11/1, 2021 at 11:23 Comment(0)
M
0

Look in the logs folder of the application service exe (The visual studio project bin\log or wherever you are logging) that you are running to launch the web server. This has earlier log errors than IIS web call related failures, e.g. Unable to resolve service for type ... Also enable logging in your ASP.NET.Core Startup function since the errors may be happening there that cause the client to receive the Internal Server Error 500 error.

Also enable stdoutLogEnabled="true" in web.config

Minutely answered 10/8, 2023 at 10:26 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.