Multiple ASP.NET Core / 5+ apps on the same web hosting

From ASP.NET Core 3.0 or .NET 5 and newer, apps are set to use the InProcess hosting model instead of OutOfProcess.

The InProcess model only allows one app per app pool, which can cause problems if you publish multiple apps on the same webhosting plan, as each webhosting plan is allocated one app pool.

As a work‑around you can set your apps to use the OutOfProcess model instead.

This can be done via the .csproj file in Visual Studio.

  1. Choose “Project” in the menu bar
  2. Click “Edit project file”
  3. The .csproj file opens. Insert <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> under the “TargetFramework” line.

It can also be changed in web.config after publishing. In <aspNetCore /> the “hostingModel” is defined and can be changed to “OutOfProcess”. With this solution you must remember to change it after new deployments.

Article from the support category: ASP & ASP.NET

Other relevant articles