Asp.net-core – ASP.NET Core 3.0 project fails to run under IIS Express: HTTP Error 500.30 – ANCM In-Process Start Failure // ERROR: Unknown command ‘%LAUNCHER_ARGS%’

asp.net-coreasp.net-core-3.0iis-express

I migrated a project from asp.net core 2.2 to 3.0 following the migration guide.

After a couple issues were resolved, starting it with dotnet run worked fine.

However when I try to run/debug with IIS Express, I get the following error:

HTTP Error 500.30 – ANCM In-Process Start Failure

Common solutions to this issue:

  • The application failed to start
  • The application started but then stopped
  • The application started but threw an exception during startup

Troubleshooting steps:

  • Check the system event log for error messages
  • Enable logging the application process' stdout messages
  • Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265

The output window for "ASP.NET Core Web Server" in Visual Studio shows the follwing error:

ERROR: Unknown command '%LAUNCHER_ARGS%'

As does an error entry in the windows event viewer

<EventData>
  <Data>Application '/LM/W3SVC/2/ROOT' with physical root 'C:\Path\To\Project\' has exited from Program.Main with exit code = '1'. First 30KB characters of captured stdout and stderr logs: ERROR: Unknown command '%LAUNCHER_ARGS%'</Data> 
  <Data>Process Id: 7092.</Data> 
  <Data>File Version: 13.0.19258.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: aee5e4080331553ea9dfb7fb388b6d72f715bf6a</Data> 
</EventData>

Immediately followed by:

<EventData>
  <Data>Application '/LM/W3SVC/2/ROOT' with physical root 'C:\Path\To\Project\' failed to load coreclr. Exception message: CLR worker thread exited prematurely</Data> 
  <Data>Process Id: 7092.</Data> 
  <Data>File Version: 13.0.19258.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: aee5e4080331553ea9dfb7fb388b6d72f715bf6a</Data> 
</EventData>

My initial thought was that there was an issue with my system setup, but a fresh ASP.NET Core 3.0 project runs without issues in IIS Express. I compared the two applicationhost.config files of the projects and they're identical (except differences like the project name). I also can't find any meaningful differences in the other project files (Project.csproj, appsettings.json, launchSettings.json). I also tried deleting the .vs folder and .user files .

The error messages suggests that it's not a problem with my code. As does the fact that there's no exception the attached debugger breaks at and that everything seems to work fine using dotnet run. Yet a fresh project created via template runs without those issues.

Best Answer

I was able to identify the issue. One mistake I made was to attribute the ERROR: Unknown command message to ASP.NET, when it was actually our application that complained.

The %LAUNCHER_ARGS% parameter is still passed to the application, but it's no longer set in an in-process hosting context.

More details here: https://github.com/aspnet/AspNetCore/issues/14735