0

I've been having this error happen on even the simplest "Hello world" ASP.NET Core web app in Visual Studio. (Win 10 Pro, IIS Express, VS 2019 CE.) Steps to reproduce:

  1. Create a new ASP.NET Core or ASP.NET Core MVC solution in Visual Studio 2019. Select the options to generate the scaffolding code for the basic "hello world" app. It doesn't matter whether you target .NET Core 2.1, .NET Core 3.1, or .NET 5.0, the result is the same in the scenarios I attempted.

  2. The project and solution loads and the source code is visible and looks correct. Press F5 to run it. App compiles but does not run.

Expected behavior: the "hello world" app loads.

Actual behavior: shows this error message in the web browser:

"HTTP Error 500.30 - ASP.NET Core app failed to start" (and some troubleshooting steps, then) "For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265".

  1. Go ahead and follow that link, then use those resources to double-check that you have all the needed packages and your IIS is configured properly. Mine was all looking good on my machine, but still I was getting this error. I even tried reinstalling VS, the hosting bundle, IIS, etc. but to no avail.

NOTE: This issue is a little different than the "500.32 ANCM Failed To Load DLL" or the "500.36 ANCM Out-Of-Process Handler Load Failure" errors, but I also encountered those during my troubleshooting, so I'm mentioning them here in case it helps someone else.

NOTE ALSO: you do not necessarily have a corrupted ASP.NET Core Module as this documentation would have you believe.

  1. Check the event logs, you'll find some errors in there, but those are not particularly helpful in diagnosing the issue in this case. In my case, it just says

"Application '/LM/W3SVC/2/ROOT' with physical root 'H:\Repo (R;)\sandbox\AspNetCoreWebApp001\AspNetCoreWebApp001' failed to load coreclr. Exception message: CLR worker thread exited prematurely"

and

"Application has exited from Program.Main with exit code = '-2147450743'. Please check the stderr logs for more information."

They show IIS Express AspNetCore Module as the source. Vendor docs were not terribly helpful on this scenario.

  1. Double check to be sure you've got your IIS configration correct, and that you have the right packages installed, including the .NET Core Hosting Bundle. If you don't, or if you're trying different configurations like I was during troubleshooting, then you might see the ANCM errors mentioned above. If you get those errors, here are two links that can help. I read those links and checked my machine carefully, multiple times. In my case, this was all correct and complete, and I still had the error.

  2. Fight with the computer some more, call it some bad names, reinstall Visual Studio for the 3rd time, verify IIS settings for the 8th time, ask your friends for help, check SO and Google yet again. The simple hello world app still won't run, same error. It runs on another machine, so there's nothing wrong with the code itself.

  • Thanks for posting this, it could be useful for somebody. I wonder though if it would better better if the post title was more explicit, like ‘500.30 error when starting app when solution path contains a semi-colon”? – stuartd Jun 20 '21 at 00:51
  • seems same question here as well https://stackoverflow.com/questions/53811569/http-error-500-30-ancm-in-process-start-failure – lsc Jun 20 '21 at 02:06
  • I like your idea. I had considered titling it like that at first, but decided instead to approach it from the problem I had been facing. My thought was doing it that way might help someone who hadn't considered the semicolon issue, such as myself. It was so maddening to discover it was "only" a semicolon in my path and not some new .NET Core setting I was unaware of. – eclipsingthebinary Jun 20 '21 at 02:08
  • Thanks. ANCM process failure errors are a slightly different issue. I encountered those as well, but it was only when I was reinstalling things. I did not find them to be related to the semicolon issue. – eclipsingthebinary Jun 20 '21 at 02:09

1 Answers1

3

This was the solution that eventually fixed it on my machine: I moved the solution to a different folder. HUH??? How could that possibly fix this issue, I asked. After more head-banging, I eventually arrived at the root cause: a semicolon in the path. Yup. In my case, I had been storing the solution in a directory called "H:\Repo (R;)". It turns out, even though the ; character is allowed by the Windows OS, the .NET CLR does not like it at all and doesn't know what to do with it. So it generates the unhelpful error message.

Try it out. Rename the folder of your "this should be working" solution to remove the semicolons, close and reopen the solution in VS, press F5 and watch it run. Or go to a working solution and rename the folder to contain a semicolon and watch it break the CLR.

I was curious whether any other special characters in a folder name would cause an issue, so I checked them all (on folders, not on filenames, but I'd expect a similar result for filenames too). Here's my exhaustive test:

Windows disallows these in folder names:

\/:*?"<>|

The solution will load and run when the path contains any of these special characters:

`~-_+=',.()[]{}!@#$%&

However, having any of these characters in the path, while being allowed by Windows, will cause issues in the CLR or in Visual Studio:

; Causes "HTTP Error 500.30 - ASP.NET Core app failed to start"

^ VS fails to load the solution & shows error message as follows:

"The following files were specified on the command line: <the .sln file> These files could not be found and will not be loaded." A totally empty instance of VS loads instead.

I also tried creating a new "hello world" console app in VS under a folder containing a semicolon in the name, and guess what? That also fails to run. Though in that case, obviously there is no HTTP error from IIS. Instead, it says

"Failed to create CoreCLR, HRESULT: 0x80070057"

and throws a process exit code. Once again, it's the result of having a semicolon in the path, because removing that semicolon from the path and reloading the solution in VS allows it to run correctly. So the semicolon issue seems to be originating from the CLR and therefore is unrelated to IIS.

Here are some related posts regarding the root cause, which is not readily apparent for web apps running on IIS Express:

Failed to create CoreCLR, HRESULT: 0x80070057

https://github.com/dotnet/sdk/issues/13954

So, kudos to those authors for those posts which were very helpful in the RCA.

One would think that the special characters allowed by the OS would also be fair game to use in the path to your Visual Studio code. Oh well. Lesson learned.