Updated March 30, 2023
Introduction to ASP.NET Core Module
ASP.NET Core Module is abbreviated as ANCM, and it is a native IIS module that fastens into the pipeline of IIS and transmits the traffic to the backend ASP.NET Core Application. The core Application of ASP.NET executes in the process separate from the IIS worker process. The ASP.NET Core Module performs the process management.
What is Asp.Net Core Module?
ASP.NET Core Module (ANCM) is a native IIS module that plugs into the IIS pipeline and transmits the traffic to the backend ASP.NET Core Application. The ASP.NET Core Module performs the process management. ANCM will start the process for the application of ASP.NET Core starts with the arrival of the first request and restarts it while it crashes. Then, it hosts the core app inside the IIS worker process, called the in-process hosting model, and forwards the web requests to the back-end core app executing in the kestrel server, an out-process hosting model. Briefly, it stays back in IIS, and it routes the web request for a core application to Kestral.
Creating Asp.Net Core Module Application
In ASP.NET Core, it provides the area attribute for developing the modular web application; each module is built as an area in ASP.NET Core Application. Let’s see the following steps for giving the complete information to build an ASP.NET Web Application with the area feature,
To create a new project of ASP.NET Core Application with area feature, include the area feature in the application.
It was once creating the new project application naming the solution and right-click the application to include the Add menu by clicking the area in the list.
To give the appropriate name for your area in Add Area,
To routing the areas in the Core ASP.NET Web Application, the configuration for routing includes the Startup.cs file in the Web Application root. To routing the path template for areas presented in the code snippet as follows,
// to routing the path model for action methods and controllers in areas
routes.MapRoute(
name: "areas",
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
// to routing the path model for action methods and controllers in the application root
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
Configured Asp.Net Core Module
ASP.NET Core Module configured through the site/application of web. config file which has its own configuration section with the system.webServer – aspNetCore. Let’s see the configuration attributes as follows,
Attributes | Description |
processPath | It requires the string attributes. Launching the script will initiate the process of listening for HTTP requests or executable paths.
Supported by relative paths and the path is considered to be relative t the root site if the path begins with “.”. No default value. |
Arguments | String attributes are optional.
The scripts are specified in the processPath and the arguments to be executable mode. The empty string is the default value here. |
startupTimeLimit | The integer attribute is the optional one.
The scripts to start the process for listening on the port. The second’s duration for handlers will wait for the executable. When exceeding the time limit, the handler will automatically kill the process and again launch it to attempt the startupRetryCount times. A default value is 120. |
shutdownTimeLimit | The integer attribute is the optional one.
The second’s duration for handlers will wait for the executable or shutdowns the script if the file app_offline.htm is noticed. A default value is 10. |
rapidFailsPerMinute | The integer attribute is the optional one.
A default value is 10. It notifies the number of times the process identifies in processPath, which allows it to crash per minute. The handler will stop launching the process for the remainder of a minute when the limit is exceeded. |
requestTimeOut | The timespan attribute is the optional one here.
It denotes the time duration for ASP.NET Core Module, which will wait for responding from a process listening on %ASPNETCORE_PORT% A default value is “00:02:00”. |
sdtoutLogEnabled | Boolean Attribute is the optional one here.
The default value is false. If the value sets to true, then the stdout and stderr for the process denoted in processPath be redirected to the file identified in stdoutLogFile. |
stdoutLogFile | The string Attribute is an optional one here.
To specify the exact or relative file path for stderr and stdout from process denoted in processPath will logged. The paths of relative are relative to the root site. The path starting with “.” will be relative to the site root, and former paths are treated as absolute paths. aspnetcore-stdout is the default value. |
forwardWindowsAuthToken | The values specified are true or false.
When the value sets to true, the tokens are forwarded to the child process, which listens on %ASPNETCORE_PORT% as a header ‘MS-ASPNETCORE-WINAUTHTOKEN’ as per the request. The responsibility of that process is to call the CloseHandle on this token as per the request.
False is the default value here. |
disableStartUpErrorPage | The values specified are true or false.
When true sets, the Process Failure page of 502.5 will be suppressed and the 502 code page status configured on the web. config takes precedences. |
Let’s see the following Child Elements,
Attribute | Description |
environmentVariables | This is specified in the process to configure the environmentVariables collection for processPath. |
recycleOnFileChange | To denote the list of files to observe, if any of the files are deleted or updated, the Core Module restarts the backend process. |
Install ASP.NET Core Module
To install the core module, use this .NET Core Windows Server Hosting to install the bundle on the server. It will install the ASP.NET Core Module, .NET Core Runtime, and .NET Core Library. ASP.NET Core Module installed with .NET Core Runtime from .NET Core Hosting Bundle. It is then forward and backward compatible with LTS releases of .NET. The security advisories and the breaking changes are descript in the Announcements repo. Here the announcements are limited to denote the version by choosing the Label filter.
Breaking changes and security advisories are reported on the Announcements repo. Additionally, announcements can be limited to a specific version by selecting a Label filter.
For the ASP.NET Core application, IIS Express relies on ASP.NET Core Module,
Asp.Net Core Module Start-Up Error Page
An error occurred as HTTP 502.5 status code page if ASP.NET Core Module does not succeed in launching the backend process or the backend process commences, but it fails to listen on the configured port. If the above said occurs Process Failure – HTTP Error 502.5 displayed, see below as follows,
To restrain the page and go back to your old ways to default IIS 502 status code page, use the attribute disableStartUpErrorPage.
Conclusion
This article has seen the ASP.NET Core Module and its configured attributes. I hope the article helps you to understand.
Recommended Articles
We hope that this EDUCBA information on “ASP.NET Core Module” was beneficial to you. You can view EDUCBA’s recommended articles for more information.