If you are getting this error when running the asp.net core application on our web server.
HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported
HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported
Common solutions to this issue:
Select a different application pool to create another application.
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
Why you are getting these errors?
500.34 ANCM Mixed Hosting Models Not Supported
The worker process can't run both an in-process app and an out-of-process app in the same process.
To fix this error, Microsoft recommends running apps in separate IIS application pools.
500.35 ANCM Multiple In-Process Applications in the same Process
The worker process can't run multiple in-process apps in the same process.
To fix this error, Microsoft recommends running apps in separate IIS application pools.
All your websites running in the same application pool. we assign one dedicated pool for one hosting account. So Once there are 2 or more ASP.NET core applications run with in-process mode, you will get the above error.
To solve this issue, please follow these steps:
1) Change to using ASP.NET core OutOfProcess mode.
2) Order several hosting plans to run inprocess and outprocess .net core app separately.
How to change the hosting model?
You can follow these steps to fix this issue:
-.csproj file----From your Visual Studio before Publish
- web.config file---From your website root folder after Publish
In .csproj file
Please open the .csproj file and add the below code to apply the proper hosting model.
<PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> </PropertyGroup>
In web.config
We have to publish the app and in the published folder first and then you can see the web.config
the file generated by ASP.NET Core:
<?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\DotNetCoreApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" /> </system.webServer> </location> </configuration>
Please change hostingModel="OutOfProcess".
You can visit this article to know more:
https://docs.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.1