HTTP Error 500.34 - ASP.NET Core does not support mixing hosting models

You may get this error when you host two .NET Core web applications in the same application pool using In-process hosting

HTTP Error 500.34 - ASP.NET Core does not support mixing hosting models

Common solutions to this issue:

Select a different app pool to host this app.

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

 

Solution

This error can be fixed using two methods. One solution is using different application pools for the web applications.  The other solution is changing the hosting model of the applications to "OutOfProcess." 

 Open the web.config files of the published applications. If you are using .NET 5.0 can see a configuration similar to the following inside<system.webServer> tag. 

 

<aspNetCore processPath="dotnet" arguments=".\yourapplication.dll" 
stdoutLogEnabled="true" stdoutLogFile=".\logs\stdoutlog" hostingModel="inprocess" />

Change the hostingModel from inprocess to OutOfProcess

<aspNetCore processPath="dotnet" arguments=".\yourapplication.dll" 
stdoutLogEnabled="true" stdoutLogFile=".\logs\stdoutlog" hostingModel="OutOfProcess"  />

Kestrel web server will be used instead of IIS when the hosting model is OutOfProcess. 

 

 


Search