You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -66,22 +66,26 @@ The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module):
66
66
* Calls `Program.Main`.
67
67
* Handles the lifetime of the IIS native request.
68
68
69
-
The in-process hosting model isn't supported for ASP.NET Core apps that target the .NET Framework.
70
-
71
69
The following diagram illustrates the relationship between IIS, the ASP.NET Core Module, and an app hosted in-process:
72
70
73
71

74
72
75
-
A request arrives from the web to the kernel-mode HTTP.sys driver. The driver routes the native request to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The ASP.NET Core Module receives the native request and passes it to IIS HTTP Server (`IISHttpServer`). IIS HTTP Server is an in-process server implementation for IIS that converts the request from native to managed.
73
+
1. A request arrives from the web to the kernel-mode HTTP.sys driver.
74
+
1. The driver routes the native request to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS).
75
+
1. The ASP.NET Core Module receives the native request and passes it to IIS HTTP Server (`IISHttpServer`). IIS HTTP Server is an in-process server implementation for IIS that converts the request from native to managed.
76
76
77
-
After the IIS HTTP Server processes the request, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. The app's response is passed back to IIS through IIS HTTP Server. IIS sends the response to the client that initiated the request.
77
+
After the IIS HTTP Server processes the request:
78
78
79
-
In-process hosting is opt-in for existing apps, but [dotnet new](/dotnet/core/tools/dotnet-new) templates default to the in-process hosting model for all IIS and IIS Express scenarios.
79
+
1. The request is sent to the ASP.NET Core middleware pipeline.
80
+
1. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic.
81
+
1. The app's response is passed back to IIS through IIS HTTP Server.
82
+
1. IIS sends the response to the client that initiated the request.
80
83
81
-
`CreateDefaultBuilder` adds an <xref:Microsoft.AspNetCore.Hosting.Server.IServer> instance by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIIS*> method to boot the [CoreCLR](/dotnet/standard/glossary#coreclr) and host the app inside of the IIS worker process (*w3wp.exe* or *iisexpress.exe*). Performance tests indicate that hosting a .NET Core app in-process delivers significantly higher request throughput compared to hosting the app out-of-process and proxying requests to [Kestrel](xref:fundamentals/servers/kestrel) server.
84
+
In-process hosting is opt-in for existing apps. The ASP.NET Core web templates use the in-process hosting model.
82
85
83
-
> [!NOTE]
84
-
> Apps published as a single file executable can't be loaded by the in-process hosting model.
86
+
`CreateDefaultBuilder` adds an <xref:Microsoft.AspNetCore.Hosting.Server.IServer> instance by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIIS*> method to boot the [CoreCLR](/dotnet/standard/glossary#coreclr) and host the app inside of the IIS worker process (*w3wp.exe* or *iisexpress.exe*). Performance tests indicate that hosting a .NET Core app in-process delivers significantly higher request throughput compared to hosting the app out-of-process and proxying requests to [Kestrel](xref:fundamentals/servers/kestrel).
87
+
88
+
Apps published as a single file executable can't be loaded by the in-process hosting model.
85
89
86
90
### Out-of-process hosting model
87
91
@@ -91,11 +95,14 @@ The following diagram illustrates the relationship between IIS, the ASP.NET Core
91
95
92
96

93
97
94
-
Requests arrive from the web to the kernel-mode HTTP.sys driver. The driver routes the requests to IIS on the website's configured port, usually 80 (HTTP) or 443 (HTTPS). The module forwards the requests to Kestrel on a random port for the app, which isn't port 80 or 443.
98
+
1. Requests arrive from the web to the kernel-mode HTTP.sys driver.
99
+
1. The driver routes the requests to IIS on the website's configured port. The configured port is usually 80 (HTTP) or 443 (HTTPS).
100
+
1. The module forwards the requests to Kestrel on a random port for the app. The random port isn't 80 or 443.
95
101
96
-
The module specifies the port via an environment variable at startup, and the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIISIntegration*> extension configures the server to listen on `http://localhost:{PORT}`. Additional checks are performed, and requests that don't originate from the module are rejected. The module doesn't support HTTPS forwarding, so requests are forwarded over HTTP even if received by IIS over HTTPS.
102
+
<!-- make this a bullet list -->
103
+
The ASP.NET Core Module specifies the port via an environment variable at startup. The <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderIISExtensions.UseIISIntegration*> extension configures the server to listen on `http://localhost:{PORT}`. Additional checks are performed, and requests that don't originate from the module are rejected. The module doesn't support HTTPS forwarding. Requests are forwarded over HTTP even if received by IIS over HTTPS.
97
104
98
-
After Kestrel picks up the request from the module, the request is pushed into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. Middleware added by IIS Integration updates the scheme, remote IP, and pathbase to account for forwarding the request to Kestrel. The app's response is passed back to IIS, which pushes it back out to the HTTP client that initiated the request.
105
+
After Kestrel picks up the request from the module, the request is forwarded into the ASP.NET Core middleware pipeline. The middleware pipeline handles the request and passes it on as an `HttpContext` instance to the app's logic. Middleware added by IIS Integration updates the scheme, remote IP, and pathbase to account for forwarding the request to Kestrel. The app's response is passed back to IIS, which forwards it back to the HTTP client that initiated the request.
99
106
100
107
For ASP.NET Core Module configuration guidance, see <xref:host-and-deploy/aspnet-core-module>.
The [IIS Integration Middleware](#enable-the-iisintegration-components), which configures Forwarded Headers Middleware, and the ASP.NET Core Module are configured to forward the scheme (HTTP/HTTPS) and the remote IP address where the request originated. Additional configuration might be required for apps hosted behind additional proxy servers and load balancers. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer).
164
+
The [IIS Integration Middleware](#enable-the-iisintegration-components) and the ASP.NET Core Module are configured to forward the:
165
+
166
+
* Scheme (HTTP/HTTPS).
167
+
* Remote IP address where the request originated.
168
+
169
+
The [IIS Integration Middleware](#enable-the-iisintegration-components) configures Forwarded Headers Middleware.
170
+
171
+
Additional configuration might be required for apps hosted behind additional proxy servers and load balancers. For more information, see [Configure ASP.NET Core to work with proxy servers and load balancers](xref:host-and-deploy/proxy-load-balancer).
158
172
159
173
### web.config file
160
174
@@ -190,7 +204,7 @@ Sensitive files exist on the app's physical path, such as *\<assembly>.runtimeco
190
204
191
205
### Transform web.config
192
206
193
-
If you need to transform *web.config* on publish (for example, set environment variables based on the configuration, profile, or environment), see <xref:host-and-deploy/iis/transform-webconfig>.
207
+
If you need to transform *web.config* on publish, see <xref:host-and-deploy/iis/transform-webconfig>. You might need to transform *web.config* on publish to set environment variables based on the configuration, profile, or environment.
194
208
195
209
## IIS configuration
196
210
@@ -671,7 +685,11 @@ Use a 64-bit (x64) .NET Core SDK to publish a 64-bit app. A 64-bit runtime must
671
685
672
686
### In-process hosting model
673
687
674
-
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because requests aren't proxied over the loopback adapter, a network interface that returns outgoing network traffic back to the same machine. IIS handles process management with the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
688
+
Using in-process hosting, an ASP.NET Core app runs in the same process as its IIS worker process. In-process hosting provides improved performance over out-of-process hosting because:
689
+
690
+
* Requests aren't proxied over the loopback adapter. A loopback adapter is a network interface that returns outgoing network traffic back to the same machine.
691
+
692
+
IIS handles process management with the [Windows Process Activation Service (WAS)](/iis/manage/provisioning-and-managing-iis/features-of-the-windows-process-activation-service-was).
675
693
676
694
The [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module):
0 commit comments