Visual Studio makes it easy to run your application project by using IIS installed in Windows. You don’t have to explicitly go to IIS Manager and deploy your application there. You can simply click the “Run” (green arrow) icon to view your project on browser.
While trying to run a .NET Core 3.1 application, we came across “HTTP Error 500.30 – ANCM In-Process Start Failure” error. Interestingly, the application compiled successfully. However, it gave this error when we tried to run it.
The entire error message:
HTTP Error 500.30 – ANCM In-Process Start Failure
Common causes of this issue:
– The application failed to start
– The application started but then stopped
– The application started but threw an exception during startupTroubleshooting 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
In Event Viewer, you will see the error below:
Event ID 1018, IIS Express AspNetCore Module V2
Application ‘/LM/W3SVC/2/ROOT’ with physical root ‘C:\Users\mesahin\OneDrive – Microsoft\Documents\Cases\120011424000352 – Updating .NetCore 2.2 MVC application to 3.1\pubCore1_Net3_1\pubCore1\pgiCore1\’ hit unexpected managed exception, exception code = ‘0xe0434352’. Last 4KB characters of captured stdout and stderr logs:
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.<>c__DisplayClass0_0.b__2(IISServerOptions options)
Root cause
This issue occurs because of mixing library references in the project. For example, if you are upgrading your .NET Core 2.2 application to .NET Core 3.1, you should make sure there is no reference or dependency to 2.2 libraries.
Solution for “HTTP Error 500.30 – ANCM In-Process Start Failure” error
We noticed that the .NET Core solution had a reference to 2.2 version of the Microsoft.AspNetCore
library. Removing this reference solved the issue.
Once you fix 500.30 error and continue running your application, Visual Studio may stop the process with “Syntax error” and other unexpected messages. Check this post out for step-by-step instructions to solve these issues: How to fix “Declaration expected”, “Syntax error”, and “Statement cannot appear outside of a method” errors