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/blazor/host-and-deploy/index.md
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,15 +33,31 @@ Apps are published for deployment in Release configuration.
33
33
1. To clean the target's publish folder prior to publishing the app, select **Show all settings**. Select **Settings** > **File Publish Options** > **Delete all existing files prior to publish**. Select **Save**.
34
34
1. Select the **Publish** button.
35
35
36
+
# [Visual Studio Code](#tab/visual-studio-code)
37
+
38
+
Open a command shell to the project's root directory.
39
+
40
+
Use the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command to publish the app:
41
+
42
+
```dotnetcli
43
+
dotnet publish -c Release
44
+
```
45
+
36
46
# [.NET CLI](#tab/net-cli)
37
47
38
-
Use the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command to publish the app with a Release configuration:
48
+
Use the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command to publish the app:
39
49
40
50
```dotnetcli
41
51
dotnet publish -c Release
42
52
```
43
53
44
-
The `dotnet publish` command generates the necessary files for deployment based on the current state of the project and places the files into the specified output folder. The command doesn't automatically clean the target folder before publishing the app.
54
+
---
55
+
56
+
Publishing the app triggers a [restore](/dotnet/core/tools/dotnet-restore) of the project's dependencies and [builds](/dotnet/core/tools/dotnet-build) the project before creating the assets for deployment. As part of the build process, unused methods and assemblies are removed to reduce app download size and load times.
57
+
58
+
## Empty the target publish folder
59
+
60
+
When using the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command in a command shell to publish an app, the command generates the necessary files for deployment based on the current state of the project and places the files into the specified output folder. The command doesn't automatically clean the target folder before publishing the app.
45
61
46
62
To empty the target folder automatically before the app is published, add the following MSBuild target to the app's project file:
47
63
@@ -51,10 +67,6 @@ To empty the target folder automatically before the app is published, add the fo
51
67
</Target>
52
68
```
53
69
54
-
---
55
-
56
-
Publishing the app triggers a [restore](/dotnet/core/tools/dotnet-restore) of the project's dependencies and [builds](/dotnet/core/tools/dotnet-build) the project before creating the assets for deployment. As part of the build process, unused methods and assemblies are removed to reduce app download size and load times.
0 commit comments