For ASP.NET Hosting

In this article we will show you how you can run several ASP.NET applications simultaneously on one hosting package.

Prerequisites

You have access to the web.config files of your applications

Background

In ASP.NET hosting - as is usual in shared hosting - only one IIs application pool is available per hosting package. By default, ASP.NET Core applications use the in-process hosting model of the ASP.NET Core Module (ANCM) in the IIS web server. However, this model does not support the simultaneous use of an application pool by several applications.

Switch applications to out-of-process hosting model

To be able to run several applications in parallel, you must therefore switch all applications to the out-of-process hosting model. With this configuration, your applications run in separate processes outside the IIS application pool, which enables parallel operation. This is done by a simple change in the web.config file of each application:

  • Navigate to the root directory of your ASP.NET Core application and open the web.config file.

  • Search for theASP.NET Core module section. This begins with <aspNetCore>.

  • Replace the attribute hostingModel="inprocess" with hostingModel="outoufprocess".

    Example:

    <aspNetCore processPath="dotnet" arguments=".\example.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="outofprocess" />

  • Save the web.config file.
  • Repeat the change for all other ASP.NET Core applications.
Note

Please note that parallel operation only works if all ASP.NET Core applications have been switched to the out-of-process hosting model. Mixed operation of in-process and out-of-process is not possible.

Further information

Further information on the hosting models of the ASP.NET Core module can be found here: