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
Copy file name to clipboardExpand all lines: aspnetcore/tutorials/publish-to-iis.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,17 @@
1
1
---
2
2
title: Publish an ASP.NET Core app to IIS
3
+
ai-usage: ai-assisted
3
4
author: wadepickett
4
5
description: Learn how to host an ASP.NET Core app on an IIS server.
5
-
monikerRange: '>= aspnetcore-2.1'
6
+
monikerRange: '>= aspnetcore-8.0'
6
7
ms.author: wpickett
7
8
ms.custom: mvc
8
-
ms.date: 10/03/2019
9
+
ms.date: 02/23/2026
9
10
uid: tutorials/publish-to-iis
10
11
---
11
12
# Publish an ASP.NET Core app to IIS
12
13
13
-
This tutorial shows how to host an ASP.NET Core app on an IIS server.
14
+
Internet Information Services (IIS) is a flexible, general-purpose web server that runs on Windows and can host ASP.NET Core apps. IIS is a good choice when you need to run ASP.NET Core apps on Windows Server in an on-premises or hybrid environment, need Windows Authentication, or require integration with other IIS features such as URL Rewrite, Application Request Routing, or centralized certificate management.
14
15
15
16
This tutorial covers the following subjects:
16
17
@@ -37,6 +38,8 @@ This tutorial covers the following subjects:
37
38
38
39
Install the *.NET Hosting Bundle* on the IIS server. The bundle installs the .NET Runtime, .NET Library, and the [ASP.NET Core Module](xref:host-and-deploy/aspnet-core-module). The module allows ASP.NET Core apps to run behind IIS.
39
40
41
+
ASP.NET Core apps hosted in IIS use the *in-process hosting model* by default (since ASP.NET Core 3.0). In-process hosting runs the app in the same process as the IIS worker process (`w3wp.exe`), which provides better performance than out-of-process hosting. For more information, see <xref:host-and-deploy/iis/index>.
@@ -74,14 +77,18 @@ Create any type of ASP.NET Core server-based app.
74
77
* The app is published to a folder.
75
78
* The folder's contents are moved to the IIS site's folder (the **Physical path** to the site in IIS Manager).
76
79
80
+
ASP.NET Core apps can be published as *framework-dependent* (the server must have .NET installed) or *self-contained* (includes the .NET runtime in the published output). For most IIS deployments, the framework-dependent approach is recommended because the .NET Hosting Bundle provides the required runtime on the server. For more information, see [.NET application deployment](/dotnet/core/deploying/).
81
+
82
+
A `web.config` file is generated automatically when the app is published. IIS uses this file to configure the ASP.NET Core Module for the app. Don't remove or manually edit the `web.config` file unless you're making advanced configuration changes.
83
+
77
84
# [Visual Studio](#tab/visual-studio)
78
85
79
86
1. Right-click on the project in **Solution Explorer** and select **Publish**.
80
-
1. In the **Pick a publish target** dialog, select the **Folder** publish option.
81
-
1. Set the **Folder or File Share** path.
87
+
1. In the **Publish** dialog, select **Folder**as the publish target and select **Next**.
88
+
1. Set the **Folder location** path.
82
89
* If you created a folder for the IIS site that's available on the development machine as a network share, provide the path to the share. The current user must have write access to publish to the share.
83
-
* If you're unable to deploy directly to the IIS site folder on the IIS server, publish to a folder on removable media and physically move the published app to the IIS site folder on the server, which is the site's **Physical path** in IIS Manager. Move the contents of the `bin/Release/{TARGET FRAMEWORK}/publish` folder to the IIS site folder on the server, which is the site's **Physical path** in IIS Manager.
84
-
1. Select the **Publish** button.
90
+
* If you're unable to deploy directly to the IIS site folder on the IIS server, publish to a folder on removable media and physically move the published app to the IIS site folder on the server, which is the site's **Physical path** in IIS Manager. Move the contents of the `bin/Release/{TARGET FRAMEWORK}/publish` folder (where `{TARGET FRAMEWORK}` is the target framework moniker, for example `net10.0`) to the IIS site folder on the server, which is the site's **Physical path** in IIS Manager.
91
+
1. Select **Finish** and then select **Publish**.
85
92
86
93
# [.NET CLI](#tab/net-cli)
87
94
@@ -91,7 +98,7 @@ Create any type of ASP.NET Core server-based app.
91
98
dotnet publish --configuration Release
92
99
```
93
100
94
-
1. Move the contents of the `bin/Release/{TARGET FRAMEWORK}/publish` folder to the IIS site folder on the server, which is the site's **Physical path** in IIS Manager.
101
+
1. Move the contents of the `bin/Release/{TARGET FRAMEWORK}/publish` folder (where `{TARGET FRAMEWORK}` is the target framework moniker, for example `net10.0`) to the IIS site folder on the server, which is the site's **Physical path** in IIS Manager.
95
102
96
103
---
97
104
@@ -144,9 +151,6 @@ To learn more about hosting ASP.NET Core apps on IIS, see the IIS Overview artic
144
151
*[IIS documentation](/iis)
145
152
*[Getting Started with the IIS Manager in IIS](/iis/get-started/getting-started-with-iis/getting-started-with-the-iis-manager-in-iis-7-and-iis-8)
0 commit comments