What are ASP.NET Core hosting modules for and how do I implement them?
What do I need to know about default ASP .NET Core hosting modules and how they affect AppDynamics APM .NET Agent configuration?
In this article...
- Who would use this workflow?
- What is a Hosting Module?
- What are the defaults?
- Implementation
- InProcess hosting module
- OutOfProcess hosting module
Who would use this workflow?
ASP.NET Core has two hosting modules that change how the AppDynamics APM .NET Agent needs to be configured. The default hosting module is different for the different .NET Core versions.
This discussion is largely centered around using Windows.
What is a Hosting Module?
The ASP.NET Core Module (ANCM) is a native IIS module that plugs into the IIS pipeline, allowing ASP.NET Core applications to work with IIS. Run ASP.NET Core apps with IIS by either:
- Hosting an ASP.NET Core app inside of the IIS worker process (w3wp.exe), called the in-process hosting model.
- Forwarding web requests to a backend ASP.NET Core app running the Kestrel server, called the out-of-process hosting model.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module
What are the defaults?
.NET Core 1.0 - 2.1 uses InProcess hosting module by default.
In .NET Core 2.2, the default hosting module was switched to OutOfProcess:
Versions of .NET Core later than the writing of this article use InProcess hosting module. Please validate the default by visiting https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module.
Note: It is not recommended to use versions of .NET Core that are not LTS. The above text is informational only and it is strongly recommended to keep your version of .NET Core up to date with the latest LTS version. https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
Implementation with InProcess hosting
If your application is using InProcess hosting module you will implement using the IIS section in the config.xml:
<IIS>
<applications>
<application path="/" site="ASP NET Core">
<tier name="My InProcess ASP.NET Core Site"/>
</application>
</applications>
</IIS>
For more information regarding IIS configuration for the agent, please visit: https://docs.appdynamics.com/appd/23.x/latest/en/application-monitoring/install-app-server-agents/ne...
Implementation with OutOfProcess Hosting
If your application is using OutOfProcess hosting module you will implement using the standalone-application section in the config.xml. With OutOfProcess there should be a dotnet.exe or yourapp.exe running.
If yourapp.exe is present:
<standalone-application executable="yourapp.exe">
<tier name="My OutOfProcess NET Core App" />
</standalone-application>
If dotnet.exe is present:
<standalone-application executable="dotnet.exe" command-line="yourapp.dll">
<tier name="My OutOfProcess NET Core App" />
</standalone-application>
For more information regarding standalone-application configuration for the agent, please visit: https://docs.appdynamics.com/appd/23.x/latest/en/application-monitoring/install-app-server-agents/ne...
The easiest way to confirm your hosting module is to open Task Manager and identify if there are any dotnet.exe or yourapp.exe running on the machine. Please validate that the application is running first by sending a couple of requests to the site.