HTTP Error 500.30 - ANCM In-Process Start Failure

Solution 1:

In ASP.NET Core 2.2, a new Server/ hosting pattern was released with IIS called IIS InProcess hosting. To enable inprocess hosting, the csproj element AspNetCoreHostingModel is added to set the hostingModel to inprocess in the web.config file. Also, the web.config points to a new module called AspNetCoreModuleV2 which is required for inprocess hosting.

If the target machine you are deploying to doesn't have ANCMV2, you can't use IIS InProcess hosting. If so, the right behavior is to either install the dotnet hosting bundle to the target machine or downgrade to the AspNetCoreModule.

Source: jkotalik (Github)

Try changing the section in csproj (edit with a text editor)

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>

to the following ...

 <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
    <AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>
 </PropertyGroup>

Source (Github)

Solution 2:

From ASP.NET Core 3.0+ and visual studio 19 version 16.3+ You will find section in project .csproj file are like below-

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

There is no AspNetCoreHostingModel property there. You will find Hosting model selection in the properties of the project. Right-click the project name in the solution explorer. Click properties.

enter image description here

Click the Debug menu.

enter image description here

enter image description here

Scroll down to find the Hosting Model option.

enter image description here

Select Out of Process.

enter image description here

Save the project and run IIS Express.

UPDATE For Server Deployment:

When you publish your application in the server there is a web config file like below:

enter image description here

change value of 'hostingModel' from 'inprocess' to 'outofprocess' like below:

enter image description here

From Several Comments, I have learnt that 'OutOfProcess' is worked for them instead of 'outofprocess'.

Solution 3:

In my case I had recently changed a database connection string in my appstettings.json file. Without logging or error catching in place I suspect this error wound up causing the "HTTP Error 500.30 - ANCM In-Process Start Failure" error.

I happened to notice the exchange between x-freestyler and Tahir Khalid where Tahir suggested an IOC problem in startup. Since my startup had not changed recently but my appstettings.json had - I determined that the connection string in my appstettings.json was the cause of the problem. I corrected an incorrect connection string and the problem was solved. Thanks to the whole community.

Solution 4:

If you are using Visual Studio, and have any instances of it running, close them all.

You should find a .vs sub folder where your Visual Studio solution (.sln file) resides.
Delete the .vs folder and try again with the in-process hosting model.