Skip to content

Commit 84eb7f9

Browse files
lootle1wadepickett
andauthored
Light Freshness Edit: ASP.NET - host and deploy (#37034)
* Light Freshness Edit: ASP.NET * Edits4 * Update aspnetcore/host-and-deploy/proxy-load-balancer.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/proxy-load-balancer.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/aspnet-core-module.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/aspnet-core-module.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/aspnet-core-module.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/aspnet-core-module.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/proxy-load-balancer.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> * Update aspnetcore/host-and-deploy/iis/index.md Co-authored-by: Wade Pickett <wpickett@microsoft.com> --------- Co-authored-by: Wade Pickett <wpickett@microsoft.com>
1 parent d93c447 commit 84eb7f9

7 files changed

Lines changed: 151 additions & 152 deletions

File tree

aspnetcore/host-and-deploy/aspnet-core-module.md

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

aspnetcore/host-and-deploy/azure-iis-errors-reference.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: tdykstra
44
description: Provides troubleshooting advice for the most common errors when hosting ASP.NET Core apps on Azure Apps Service and IIS.
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: tdykstra
7-
ms.date: 7/23/2024
7+
ms.date: 04/21/2026
88
uid: host-and-deploy/azure-iis-errors-reference
99
---
1010

@@ -14,25 +14,25 @@ uid: host-and-deploy/azure-iis-errors-reference
1414

1515
:::moniker range=">= aspnetcore-6.0"
1616

17-
This topic describes the most common errors and provides troubleshooting advice when hosting ASP.NET Core apps on Azure Apps Service and IIS.
17+
This article describes the most common errors and provides troubleshooting advice when hosting ASP.NET Core apps on Azure Apps Service and IIS.
1818

1919
See <xref:test/troubleshoot-azure-iis> information on common app startup errors and instructions on how to diagnose errors.
2020

2121
Collect the following information:
2222

2323
* Browser behavior such as status code and error message.
24-
* Application Event Log entries
24+
* Application Event Log entries.
2525
* Azure App Service: See <xref:test/troubleshoot-azure-iis>.
2626
* IIS
2727
1. Select **Start** on the **Windows** menu, type *Event Viewer*, and press **Enter**.
2828
1. After the **Event Viewer** opens, expand **Windows Logs** > **Application** in the sidebar.
29-
* ASP.NET Core Module stdout and debug log entries
29+
* ASP.NET Core Module stdout and debug log entries.
3030
* Azure App Service: See <xref:test/troubleshoot-azure-iis>.
31-
* IIS: Follow the instructions in the [Log creation and redirection](xref:host-and-deploy/aspnet-core-module#log-creation-and-redirection) and [Enhanced diagnostic logs](xref:host-and-deploy/iis/logging-and-diagnostics#enhanced-diagnostic-logs) sections of the ASP.NET Core Module topic.
31+
* IIS: Follow the instructions in the [Log creation and redirection](xref:host-and-deploy/aspnet-core-module#log-creation-and-redirection) and [Enhanced diagnostic logs](xref:host-and-deploy/iis/logging-and-diagnostics#enhanced-diagnostic-logs) sections of the ASP.NET Core Module article.
3232

3333
Compare error information to the following common errors. If a match is found, follow the troubleshooting advice.
3434

35-
The list of errors in this topic isn't exhaustive. If you encounter an error not listed here, open a new issue using the **Content feedback** button at the bottom of this topic with detailed instructions on how to reproduce the error.
35+
The list of errors in this article isn't exhaustive. If you encounter an error not listed here, open a new issue using the **Content feedback** button at the bottom of this article with detailed instructions on how to reproduce the error.
3636

3737
[!INCLUDE[Azure App Service Preview Notice](~/includes/azure-apps-preview-notice.md)]
3838

@@ -293,7 +293,7 @@ Troubleshooting:
293293

294294
The process failed to start, most likely due to an app configuration or programming issue.
295295

296-
For more information, see the following topics:
296+
For more information, see the following articles:
297297

298298
* <xref:test/troubleshoot-azure-iis>
299299
* <xref:test/troubleshoot>

aspnetcore/host-and-deploy/iis/advanced.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Advanced configuration with the ASP.NET Core Module and Internet In
55
monikerRange: '>= aspnetcore-5.0'
66
ms.author: tdykstra
77
ms.custom: mvc, sfi-image-nochange
8-
ms.date: 03/07/2025
8+
ms.date: 04/21/2026
99
uid: host-and-deploy/iis/advanced
1010
---
1111
# Advanced configuration of the ASP.NET Core Module and IIS
@@ -34,7 +34,7 @@ Configure the managed stack size using the `stackSize` setting in hexadecimal by
3434

3535
## Disallow rotation on config
3636

37-
The `disallowRotationOnConfigChange` setting is intended for blue/green scenarios where a change to global config should not cause all sites to recycle. When this flag is true, only changes relevant to the site itself will cause it to recycle. For example, a site recycles if its *web.config* changes or something changes that is relevant to the site's path from IIS's perspective. But a general change to *applicationHost.config* would not cause an app to recycle. The following example sets this setting to true:
37+
The `disallowRotationOnConfigChange` setting is intended for blue/green scenarios where a change to global config shouldn't cause all sites to recycle. When this flag is true, only changes relevant to the site itself will cause it to recycle. For example, a site recycles if its *web.config* changes or something changes that's relevant to the site's path from IIS's perspective. But a general change to *applicationHost.config* wouldn't cause an app to recycle. The following example sets this setting to true:
3838

3939
```xml
4040
<aspNetCore processPath="dotnet"
@@ -48,11 +48,11 @@ The `disallowRotationOnConfigChange` setting is intended for blue/green scenario
4848
</aspNetCore>
4949
```
5050

51-
This setting corresponds to the API <xref:Microsoft.Web.Administration.ApplicationPoolRecycling.DisallowRotationOnConfigChange?displayProperty=nameWithType>
51+
This setting corresponds to the <xref:Microsoft.Web.Administration.ApplicationPoolRecycling.DisallowRotationOnConfigChange?displayProperty=nameWithType> API.
5252

5353
## Reduce 503 likelihood during app recycle
5454

55-
By default, there is a one second delay between when IIS is notified of a recycle or shutdown and when ANCM tells the managed server to initiate shutdown. The delay is configurable via the `ANCM_shutdownDelay` environment variable or by setting the `shutdownDelay` handler setting. Both values are in milliseconds. The delay is primarily to reduce the likelihood of a race where:
55+
By default, there's a one-second delay between when IIS is notified of a recycle or shutdown and when ANCM tells the managed server to initiate shutdown. The delay is configurable via the `ANCM_shutdownDelay` environment variable or by setting the `shutdownDelay` handler setting. Both values are in milliseconds. The delay is primarily to reduce the likelihood of a race where:
5656

5757
* IIS hasn't started queuing requests to go to the new app.
5858
* ANCM starts rejecting new requests that come into the old app.
@@ -104,9 +104,9 @@ The [ASP.NET Core Data Protection stack](xref:security/data-protection/introduct
104104

105105
If the Data Protection key ring is stored in memory when the app restarts:
106106

107-
* All cookie-based authentication tokens are invalidated.
108-
* Users are required to sign in again on their next request.
109-
* Any data protected with the key ring can no longer be decrypted. This may include [CSRF tokens](xref:security/anti-request-forgery#aspnet-core-antiforgery-configuration) and [ASP.NET Core MVC TempData cookies](xref:fundamentals/app-state#tempdata).
107+
* All cookie-based authentication tokens are invalidated.
108+
* Users are required to sign in again on their next request.
109+
* Any data protected with the key ring can no longer be decrypted. This might include [CSRF tokens](xref:security/anti-request-forgery#aspnet-core-antiforgery-configuration) and [ASP.NET Core MVC TempData cookies](xref:fundamentals/app-state#tempdata).
110110

111111
To configure data protection under IIS to persist the key ring, use **one** of the following approaches:
112112

@@ -144,7 +144,7 @@ To configure data protection under IIS to persist the key ring, use **one** of t
144144

145145
## IIS configuration
146146

147-
**Windows Server operating systems**
147+
### Windows Server operating systems
148148

149149
Enable the **Web Server (IIS)** server role and establish role services.
150150

@@ -164,7 +164,7 @@ Enable the **Web Server (IIS)** server role and establish role services.
164164

165165
1. Proceed through the **Confirmation** step to install the web server role and services. A server/IIS restart isn't required after installing the **Web Server (IIS)** role.
166166

167-
**Windows desktop operating systems**
167+
### Windows desktop operating systems
168168

169169
Enable the **IIS Management Console** and **World Wide Web Services**.
170170

@@ -196,7 +196,7 @@ Enable the **IIS Management Console** and **World Wide Web Services**.
196196

197197
An ASP.NET Core app can be hosted as an [IIS sub-application (sub-app)](/iis/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis#applications). The sub-app's path becomes part of the root app's URL.
198198

199-
Static asset links within the sub-app should use tilde-slash (`~/`) notation in MVC and Razor Pages. Tilde-slash notation triggers a [Tag Helper](xref:mvc/views/tag-helpers/intro) to prepend the sub-app's pathbase to the rendered relative link. For a sub-app at `/subapp_path`, an image linked with `src="~/image.png"` is rendered as `src="/subapp_path/image.png"`. The root app's Static File Middleware doesn't process the static file request. The request is processed by the sub-app's Static File Middleware.
199+
Static asset links within the sub-app should use tilde-slash (`~/`) notation in MVC and Razor Pages. Tilde-slash notation triggers a [Tag Helper](xref:mvc/views/tag-helpers/intro) to prepend the sub-app's pathbase to the rendered relative link. For a sub-app at `/subapp_path`, an image linked with `src="~/image.png"` is rendered as `src="/subapp_path/image.png"`. The root app's Static File Middleware doesn't process the static file request. The sub-app's Static File Middleware processes the request.
200200

201201
> [!NOTE]
202202
> Razor components (`.razor`) shouldn't use tilde-slash notation. For more information, see <xref:blazor/host-and-deploy/app-base-path>.
@@ -219,10 +219,10 @@ For more information on the in-process hosting model and configuring the ASP.NET
219219

220220
## Application Pools
221221

222-
App pool isolation is determined by the hosting model:
222+
The hosting model determines app pool isolation:
223223

224-
* In-process hosting: Apps are required to run in separate app pools.
225-
* Out-of-process hosting: We recommend isolating the apps from each other by running each app in its own app pool.
224+
* **In-process hosting**: Apps are required to run in separate app pools.
225+
* **Out-of-process hosting**: We recommend isolating the apps from each other by running each app in its own app pool.
226226

227227
The IIS **Add Website** dialog defaults to a single app pool per app. When a **Site name** is provided, the text is automatically transferred to the **Application pool** textbox. A new app pool is created using the site name when the site is added.
228228

@@ -240,7 +240,7 @@ If the IIS worker process requires elevated access to the app, modify the Access
240240

241241
1. Right-click on the directory and select **Properties**.
242242

243-
1. Under the **Security** tab, select the **Edit** button and then the **Add** button.
243+
1. Under the **Security** tab, select the **Edit** button, and then the **Add** button.
244244

245245
1. Select the **Locations** button and make sure the system is selected.
246246

@@ -260,19 +260,19 @@ Access can also be granted at a command prompt using the **ICACLS** tool. Using
260260
ICACLS C:\sites\MyWebApp /grant "IIS AppPool\DefaultAppPool:(OI)(CI)RX"
261261
```
262262

263-
For more information, see the [icacls](/windows-server/administration/windows-commands/icacls) topic.
263+
For more information, see the [icacls](/windows-server/administration/windows-commands/icacls) article.
264264

265265
## HTTP/2 support
266266

267267
[HTTP/2](https://httpwg.org/specs/rfc7540.html) is supported with ASP.NET Core in the following IIS deployment scenarios:
268268

269269
* In-process
270-
* Windows Server 2016/Windows 10 or later; IIS 10 or later
271-
* TLS 1.2 or later connection
270+
* Windows Server 2016/Windows 10 or later; IIS 10 or later.
271+
* TLS 1.2 or later connection.
272272
* Out-of-process
273-
* Windows Server 2016/Windows 10 or later; IIS 10 or later
273+
* Windows Server 2016/Windows 10 or later; IIS 10 or later.
274274
* Public-facing edge server connections use HTTP/2, but the reverse proxy connection to the [Kestrel server](xref:fundamentals/servers/kestrel) uses HTTP/1.1.
275-
* TLS 1.2 or later connection
275+
* TLS 1.2 or later connection.
276276

277277
For an in-process deployment when an HTTP/2 connection is established, [`HttpRequest.Protocol`](xref:Microsoft.AspNetCore.Http.HttpRequest.Protocol*) reports `HTTP/2`. For an out-of-process deployment when an HTTP/2 connection is established, [`HttpRequest.Protocol`](xref:Microsoft.AspNetCore.Http.HttpRequest.Protocol*) reports `HTTP/1.1`.
278278

@@ -290,8 +290,8 @@ For an ASP.NET Core app that targets the .NET Framework, OPTIONS requests aren't
290290

291291
When hosted in IIS by the ASP.NET Core Module version 2:
292292

293-
* [Application Initialization Module](#application-initialization-module): App's hosted [in-process](xref:host-and-deploy/iis/in-process-hosting) or [out-of-process](xref:host-and-deploy/iis/out-of-process-hosting) can be configured to start automatically on a worker process restart or server restart.
294-
* [Idle Timeout](#idle-timeout): App's hosted [in-process](xref:host-and-deploy/iis/in-process-hosting) can be configured not to time out during periods of inactivity.
293+
* [**Application Initialization Module**](#application-initialization-module): App's hosted [in-process](xref:host-and-deploy/iis/in-process-hosting) or [out-of-process](xref:host-and-deploy/iis/out-of-process-hosting) can be configured to start automatically on a worker process restart or server restart.
294+
* [**Idle Timeout**](#idle-timeout): App's hosted [in-process](xref:host-and-deploy/iis/in-process-hosting) can be configured not to time out during periods of inactivity.
295295

296296
### Application Initialization Module
297297

@@ -356,8 +356,8 @@ To prevent apps hosted [out-of-process](xref:host-and-deploy/iis/out-of-process-
356356
### Application Initialization Module and Idle Timeout additional resources
357357

358358
* [IIS 8.0 Application Initialization](/iis/get-started/whats-new-in-iis-8/iis-80-application-initialization)
359-
* [Application Initialization `<applicationInitialization>`](/iis/configuration/system.webserver/applicationinitialization/).
360-
* [Process Model Settings for an Application Pool `<processModel>`](/iis/configuration/system.applicationhost/applicationpools/add/processmodel).
359+
* [Application Initialization `<applicationInitialization>`](/iis/configuration/system.webserver/applicationinitialization/)
360+
* [Process Model Settings for an Application Pool `<processModel>`](/iis/configuration/system.applicationhost/applicationpools/add/processmodel)
361361

362362
## Module, schema, and configuration file locations
363363

@@ -385,25 +385,25 @@ To prevent apps hosted [out-of-process](xref:host-and-deploy/iis/out-of-process-
385385

386386
### Schema
387387

388-
**IIS**
388+
**IIS**:
389389

390390
* `%windir%\System32\inetsrv\config\schema\aspnetcore_schema.xml`
391391

392392
* `%windir%\System32\inetsrv\config\schema\aspnetcore_schema_v2.xml`
393393

394-
**IIS Express**
394+
**IIS Express**:
395395

396396
* `%ProgramFiles%\IIS Express\config\schema\aspnetcore_schema.xml`
397397

398398
* `%ProgramFiles%\IIS Express\config\schema\aspnetcore_schema_v2.xml`
399399

400400
### Configuration
401401

402-
**IIS**
402+
**IIS**:
403403

404404
* `%windir%\System32\inetsrv\config\applicationHost.config`
405405

406-
**IIS Express**
406+
**IIS Express**:
407407

408408
* Visual Studio: `{APPLICATION ROOT}\.vs\config\applicationHost.config`
409409

@@ -430,17 +430,17 @@ When deploying apps to servers with [Web Deploy](/iis/install/installing-publish
430430
431431
1. Under the server's node, select **Application Pools**.
432432

433-
1. Right-click the site's app pool and select **Basic Settings** from the contextual menu.
433+
1. Right-click the site's app pool, and select **Basic Settings** from the contextual menu.
434434

435435
1. In the **Edit Application Pool** window, set the **.NET CLR version** to **No Managed Code**:
436436

437437
![Set No Managed Code for the .NET CLR version.](index/_static/edit-apppool-ws2016.png)
438438

439439
ASP.NET Core runs in a separate process and manages the runtime. ASP.NET Core doesn't rely on loading the desktop CLR (.NET CLR). The Core Common Language Runtime (CoreCLR) for .NET is booted to host the app in the worker process. Setting the **.NET CLR version** to **No Managed Code** is optional but recommended.
440440

441-
* For a 32-bit (x86) [self-contained deployment](/dotnet/core/deploying/#self-contained-deployments-scd) published with a 32-bit SDK that uses the in-process hosting model, enable the Application Pool for 32-bit. In IIS Manager, navigate to **Application Pools** in the **Connections** sidebar. Select the app's Application Pool. In the **Actions** sidebar, select **Advanced Settings**. Set **Enable 32-Bit Applications** to `True`.
441+
* For a 32-bit (x86) [self-contained deployment](/dotnet/core/deploying/#self-contained-deployments-scd) published with a 32-bit SDK that uses the in-process hosting model, enable the Application Pool for 32-bit. In IIS Manager, navigate to **Application Pools** in the **Connections** sidebar. Select the app's Application Pool. In the **Actions** sidebar, select **Advanced Settings**. Set **Enable 32-Bit Applications** to `True`.
442442

443-
* For a 64-bit (x64) [self-contained deployment](/dotnet/core/deploying/#self-contained-deployments-scd) that uses the in-process hosting model, disable the app pool for 32-bit (x86) processes. In IIS Manager, navigate to **Application Pools** in the **Connections** sidebar. Select the app's Application Pool. In the **Actions** sidebar, select **Advanced Settings**. Set **Enable 32-Bit Applications** to `False`.
443+
* For a 64-bit (x64) [self-contained deployment](/dotnet/core/deploying/#self-contained-deployments-scd) that uses the in-process hosting model, disable the app pool for 32-bit (x86) processes. In IIS Manager, navigate to **Application Pools** in the **Connections** sidebar. Select the app's Application Pool. In the **Actions** sidebar, select **Advanced Settings**. Set **Enable 32-Bit Applications** to `False`.
444444

445445
1. Confirm the process model identity has the proper permissions.
446446

@@ -457,9 +457,9 @@ Shadow copying app assemblies to the [ASP.NET Core Module (ANCM)](xref:host-and-
457457

458458
When an ASP.NET Core app is running on Windows, the binaries are locked so that they can't be modified or replaced. Shadow copying enables the app assemblies to be updated while the app is running by making a copy of the assemblies.
459459

460-
Shadow copy isn't intended to enable zero-downtime deployment, so its expected that IIS will still recycle the app, and some requests may get an [503 Service Unavailable](https://developer.mozilla.org/docs/Web/HTTP/Status/503) response. We recommend using a pattern like [blue-green deployments](https://www.martinfowler.com/bliki/BlueGreenDeployment.html) or [Azure deployment slots](/azure/app-service/deploy-best-practices#use-deployment-slots) for zero-downtime deployments. Shadow copy helps minimize downtime on deployments, but can't completely eliminate it.
460+
Shadow copy isn't intended to enable zero-downtime deployment, so it's expected that IIS will still recycle the app, and some requests might get a [503 Service Unavailable](https://developer.mozilla.org/docs/Web/HTTP/Reference/Status/503) response. We recommend using a pattern like [blue-green deployments](https://www.martinfowler.com/bliki/BlueGreenDeployment.html) or [Azure deployment slots](/azure/app-service/deploy-best-practices#use-deployment-slots) for zero-downtime deployments. Shadow copy helps minimize downtime on deployments, but it can't completely eliminate it.
461461

462-
Shadow copying is enabled by customizing the ANCM handler settings in `web.config`:
462+
Customizing the ANCM handler settings in `web.config` enables shadow copying:
463463

464464
```
465465
<?xml version="1.0" encoding="utf-8"?>

0 commit comments

Comments
 (0)