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: docs/deployment/quickstart-deploy-aspnet-web-app.md
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -102,8 +102,6 @@ Next, you see the summary page for the new [publish profile](./publish-overview.
102
102
103
103
You can come back to this summary page after you close it. Next time you right-click and choose **Publish**, Visual Studio opens this summary page. (To get back to the Publish wizard just click **New** in the summary page.)
104
104
105
-
To view or change the settings, select the **Show all settings** link, or click on any of the pencil icons. The **Settings** page appears. Here, you can change the configuration to publish, the target framework, the [deployment mode](/dotnet/core/deploying/), or the target Runtime ID (RID) (see [.NET RID catalog](/dotnet/core/rid-catalog)). You can choose to delete all the existing files in the target folder every time you publish, or not. If you expect to add files that aren't part of what Visual Studio deploys, clear the checkbox.
106
-
107
105
## [FTP/FTPS](#tab/ftp-ftps)
108
106
## Publish your web app to an FTP/FTPS server
109
107
@@ -124,7 +122,20 @@ You can come back to this summary page after you close it. The next time you rig
124
122
## [Web Server](#tab/web-server)
125
123
## Publish your web app to Web Server (IIS)
126
124
127
-
You can publish your web app to IIS.
125
+
You can publish your web app to IIS if IIS is configured. By default, IIS Express is installed, but you should install the IIS Management tools if you're deploying to IIS from Visual Studio. Note that you don't need to run Visual Studio as Administrator to deploy to IIS Express, only to full IIS.
126
+
127
+
### Configure the web server
128
+
129
+
On the remote web server, install the [Web Management Service](/iis/manage/remote-administration/remote-administration-for-iis-manager). Be sure to follow the instructions there to enable remote connections, and make sure the service is started, set up your credentials to remotely administer the web server, and verify them before attempting to deploy. Web Management Service is not required for a local IIS deployment.
130
+
131
+
On the web server, install **IIS 6 Metabase Compatibility**. In Windows Settings, under **Programs and Features**, choose **Turn Windows features on or off**. Then under **Internet Information Services** > **Web Management Tools**, install **IIS 6 Management Compatibility**. Make sure that **IIS Metabase** and **IIS 6 configuration compatibility** are selected.
132
+
133
+
To configure IIS for ASP.NET Core applications, install the [.NET Core Hosting Bundle installer (direct download)](https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer). For more information, see [.NET Core hosting bundle](/aspnet/core/host-and-deploy/iis/hosting-bundle).
134
+
135
+
If you're working with ASP.NET 4.8 or earlier, or if you need to configure IIS on Windows Server for publishing, you can find detailed steps in [Remote debugging ASP.NET on an IIS computer](../debugger/remote-debugging-aspnet-on-a-remote-iis-7-5-computer.md) and for ASP.NET Core, [Remote debugging ASP.NET Core on an IIS computer](../debugger/remote-debugging-aspnet-on-a-remote-iis-7-5-computer.md).
136
+
### Publish to IIS web server
137
+
138
+
Choose **Publish**, and then **Web Server (IIS)**.
128
139
129
140

130
141
@@ -134,11 +145,16 @@ Pick the desired deployment mode. Choose Web Deploy to immediately deploy the ap
134
145
135
146
### Web Deploy
136
147
137
-
Provide the necessary connection details and choose **Finish**.
148
+
Provide the necessary connection details and choose **Finish**. The following screenshot shows a web application published to the default IIS web site (Default Web Site) installed on the local development machine, with a port binding on port 5187. The Destination URL is optional. If not provided, the web site is not automatically launched on publish, and there won't be a link on the **Publish** screen to access the published site.
138
149
139
150

140
151
141
-
On the remote computer, make sure that Web Deploy is installed and that the Web Management Service is started. See [Web Deploy error codes](/troubleshoot/developer/webapps/iis/deployment-migration/web-deploy-error-codes#ERROR_DESTINATION_NOT_REACHABLE).
152
+
The first time you publish, create a username and password. These credentials are specific to WebDeploy deployment. Once they're created, you can't change them in Visual Studio, but you can reset them in IIS. See [Sites - Set Credentials dialog box](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh831681(v=ws.11)?redirectedfrom=MSDN#set-credentials-dialog-box). If you don't have the password, you can download a `.publishsettings` file, and read it from there. See [Import publish settings from IIS](./tutorial-import-publish-settings-iis.md).
153
+
154
+
> [!WARNING]
155
+
> Using username and password credentials is not the most secure method of authentication. Whenever possible, use alternative methods. For example, when hosting a web site in Azure App Service, you can use authentication tokens for improved security.
156
+
157
+
For troubleshooting, see [Web Deploy error codes](/troubleshoot/developer/webapps/iis/deployment-migration/web-deploy-error-codes#ERROR_DESTINATION_NOT_REACHABLE).
142
158
143
159
### Web Deploy Package
144
160
@@ -159,6 +175,10 @@ You can import publish settings [from IIS](./tutorial-import-publish-settings-ii
159
175
160
176
---
161
177
178
+
## Next steps
179
+
180
+
Manage settings for your web application deployment. By managing settings, you can control the .NET deployment options, as well as behaviors such as how to handle existing files that are not part of the deployment process at the deployment destination. See [Manage web deployment settings](web-deployment-settings.md).
description: Learn how to configure deployment settings for web applications in Visual Studio, when you publish a web application to Azure, IIS, or another target.
4
+
ms.date: 09/27/2024
5
+
ms.topic: how-to
6
+
helpviewer_keywords:
7
+
- "deployment settings, web app"
8
+
author: ghogen
9
+
ms.author: ghogen
10
+
manager: mijacobs
11
+
ms.subservice: deployment
12
+
monikerRange: '>= vs-2019'
13
+
#customer intent: As a web developer, I want to understand and control the deployment settings for my web app.
14
+
---
15
+
# Manage web deployment settings
16
+
17
+
You can control how your web application gets deployed using the settings.
18
+
19
+
## Prerequisite
20
+
21
+
Visual Studio with the Web Development workload installed.
22
+
23
+
## Manage settings
24
+
25
+
The **Show all settings** link appears after you run the **Publish** wizard to create a publish profile. The settings vary according to the type of deployment.
26
+
27
+
To view or change the settings, select the **Show all settings** link, or click on any of the pencil icons. The **Settings** page appears.
28
+
29
+
1. Click on the **Settings** link. The Settings screen opens.
30
+
1. The **Prev** button takes you to the previous screen with settings you can edit for some deployment types.
31
+
1. Expand the **File Publish Options** to view settings that relate to files that might already be on the site.
32
+
1. Expand the Database settings to view the database connection information, which can be different from what your app uses when running locally during development and testing.
33
+
34
+
The following table describes the settings. Click on the links for more information.
35
+
36
+
| Name | Profile types | Property | Description |
37
+
| - | - | - |
38
+
| Configuration | Folder, IIS |`LastUsedBuildConfiguration`| The project build configuration to deploy, for example, `Release`. |
39
+
| TargetFramework | Folder, IIS |`TargetFramework`| The version of .NET that the app is targeted to run on. This is already set by the project, but you can change it for deployment. |
40
+
|[Deployment mode](/dotnet/core/deploying/)| Folder, IIS | none or `SelfContained`| You can choose framework-dependent if you can depend on the runtime being available, or self-contained if you want to package the runtime with the application's publish artifacts. |
41
+
|[Target Runtime](/dotnet/core/rid-catalog)| Folder, IIS || The .NET Runtime ID (RID) for this deployment. |
42
+
| Server | IIS |`MSDeployServiceURL`| The web server name, URI, or IP address. For example, `localhost`. |
43
+
| Site name | IIS | Site | The site name in IIS, for example, `Default Web Site`. |
44
+
| Username | IIS |`UserName`| The username you will use to access the site in IIS. |
45
+
| Password | IIS |`UserPWD`| The first time you publish, you create a password that you will use to publish the site. The password can't be changed in Visual Studio, but it can be changed in IIS or in Azure. If you don't know the password, you can get it by downloading the `.publishsettings` file. See [Import publish settings from IIS](tutorial-import-publish-settings-iis.md) and [Import publish settings from Azure](tutorial-import-publish-settings-azure.md). |
46
+
| Save password checkbox | IIS |`_SavePWD`| If checked, saves the password as plain text in the `.pubxml` file. |
47
+
| Destination URL | IIS |`SiteURLToLaunchAfterPublish`| The URL that launches the app, for example, `http://localhost/projectname`. If the IIS configuration for the web site exposes the site on a specific port in its bindings settings, include that as in `http://localhost:nnnn/projectname`. This is optional and only provides a convenient link on the Publish page, and is used to launch the site after a successful publish. |
48
+
|[Enable ReadyToRun compilation](/dotnet/core/deploying/ready-to-run)| Folder |`PublishReadyToRun`| ReadyToRun is a form of Ahead-of-time (AOT) compilation. It can reduce latency by avoiding Just-in-time (JIT) compilation at runtime. |
49
+
|[Trim unused code](/dotnet/core/deploying/trimming/trim-self-contained)| Folder |`PublishTrimmed`| Minimizes the size of a self-contained deployment. |
50
+
|[Produce single file](/dotnet/core/deploying/single-file/overview)| Folder |`PublishSingleFile`| An option that allows the published application to be distributed in a single file. |
51
+
| Remove additional files at destination | IIS |`SkipExtraFilesOnServer`| To preserve added files, uncheck the box. |
52
+
| Delete all existing files prior to publish. | FTP |`DeleteExistingFiles`| Uncheck this to preserve unrelated files at the destination, or check this to start with a clean deployment to the folder. |
53
+
|Package location| IIS WebDeploy Package|`DesktopBuildPackageLocation`| A local filesystem path to place the output package. |
54
+
55
+
## Next steps
56
+
57
+
The settings are persisted in the `.pubxml` file. The `.pubxml` file is an MSBuild input file. You can edit the file to further customize the deployment. See [MSBuild](../msbuild/msbuild.md).
58
+
59
+
## Related content
60
+
61
+
[Visual Studio .pubxml files](/aspnet/core/host-and-deploy/visual-studio-publish-profiles)
0 commit comments