From c07ce3a3d4cefd192b2e9745fcae8e4a0273a4b4 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:03:38 -0500 Subject: [PATCH 01/11] MSBuild properties for hosted deployment options --- .../blazor/host-and-deploy/webassembly.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 7b99e1262851..db5be4e81a6a 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -175,6 +175,35 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: +## Use MSBuild properties for hosted deployment options that apply to all projects + +When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. + +The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as both a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). + +Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): + +```dotnetcli +dotnet publish -r {RID} --no-self-contained +``` + +For a hosted Blazor WebAssembly app, use of the preceding command results in a runtime error because the options apply to all of the solution's projects unconditionally. This is a current limitation of the .NET CLI/MSBuild pipeline. To resolve the problem, adopt ***either*** of the following approaches: + +* Specify the options as MSBuild properties in the `dotnet publish` command: + + ```dotnetcli + dotnet publish /p:RuntimeIdentifier={RID} /p:SelfContained=false + ``` + +* Specify the options as MSBuild properties in the **`Server`** project's project file (`.csproj`): + + ```xml + {RID} + false + ``` + +For more information, see [.NET application publishing overview](/dotnet/core/deploying/). + ## Hosted deployment with multiple Blazor WebAssembly apps For more information, see . @@ -975,6 +1004,33 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: +## Use MSBuild properties for hosted deployment options that apply to all projects + +When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. + +The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as both a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). + +Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): + +```dotnetcli +dotnet publish -r {RID} --no-self-contained +``` + +For a hosted Blazor WebAssembly app, use of the preceding command results in a runtime error because the options apply to all of the solution's projects unconditionally. This is a current limitation of the .NET CLI/MSBuild pipeline. To resolve the problem, adopt ***either*** of the following approaches: + +* Specify the options as MSBuild properties in the `dotnet publish` command: + + ```dotnetcli + dotnet publish /p:RuntimeIdentifier={RID} /p:SelfContained=false + ``` + +* Specify the options as MSBuild properties in the **`Server`** project's project file (`.csproj`): + + ```xml + {RID} + false + ``` + ## Hosted deployment with multiple Blazor WebAssembly apps For more information, see . @@ -1653,6 +1709,33 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: +## Use MSBuild properties for hosted deployment options that apply to all projects + +When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. + +The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as both a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). + +Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): + +```dotnetcli +dotnet publish -r {RID} --no-self-contained +``` + +For a hosted Blazor WebAssembly app, use of the preceding command results in a runtime error because the options apply to all of the solution's projects unconditionally. This is a current limitation of the .NET CLI/MSBuild pipeline. To resolve the problem, adopt ***either*** of the following approaches: + +* Specify the options as MSBuild properties in the `dotnet publish` command: + + ```dotnetcli + dotnet publish /p:RuntimeIdentifier={RID} /p:SelfContained=false + ``` + +* Specify the options as MSBuild properties in the **`Server`** project's project file (`.csproj`): + + ```xml + {RID} + false + ``` + ## Hosted deployment with multiple Blazor WebAssembly apps For more information, see . From ac7c2e21b7eb8e14bdd499e0d03c346d9e07c262 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:21:49 -0500 Subject: [PATCH 02/11] Updates --- aspnetcore/blazor/host-and-deploy/webassembly.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index db5be4e81a6a..d5f768df6742 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -179,7 +179,7 @@ For more information, see the following articles: When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. -The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as both a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). +The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): @@ -1008,7 +1008,7 @@ For more information, see the following articles: When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. -The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as both a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). +The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): @@ -1713,7 +1713,7 @@ For more information, see the following articles: When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. -The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as both a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). +The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): From 76fe2b8e01a6ae552304952f61a71df85e9767b9 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 3 Aug 2022 13:26:13 -0500 Subject: [PATCH 03/11] Updates --- aspnetcore/blazor/host-and-deploy/webassembly.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index d5f768df6742..4193b81ebddf 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -181,7 +181,7 @@ When publishing a hosted Blazor WebAssembly app, some of the options passed to t The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). -Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): +Normally, such a deployment is created with the following .NET CLI command that uses the runtime option (`-r|--runtime`) with the `--no-self-contained` option, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): ```dotnetcli dotnet publish -r {RID} --no-self-contained @@ -1010,7 +1010,7 @@ When publishing a hosted Blazor WebAssembly app, some of the options passed to t The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). -Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): +Normally, such a deployment is created with the following .NET CLI command that uses the runtime option (`-r|--runtime`) with the `--no-self-contained` option, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): ```dotnetcli dotnet publish -r {RID} --no-self-contained @@ -1715,7 +1715,7 @@ When publishing a hosted Blazor WebAssembly app, some of the options passed to t The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). -Normally, such a deployment is created with the following .NET CLI command, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): +Normally, such a deployment is created with the following .NET CLI command that uses the runtime option (`-r|--runtime`) with the `--no-self-contained` option, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): ```dotnetcli dotnet publish -r {RID} --no-self-contained From 73ca1ee50f249e1cebfc9ffd929e8b51361ddf2a Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 4 Aug 2022 07:55:42 -0500 Subject: [PATCH 04/11] Updates --- .../blazor/host-and-deploy/webassembly.md | 154 +++++++++++------- 1 file changed, 94 insertions(+), 60 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 4193b81ebddf..7f9a4b2e2151 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -175,32 +175,42 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: -## Use MSBuild properties for hosted deployment options that apply to all projects +## Hosted deployment of a framework-dependent executable for a specific platform -When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. +To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). - -Normally, such a deployment is created with the following .NET CLI command that uses the runtime option (`-r|--runtime`) with the `--no-self-contained` option, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): - -```dotnetcli -dotnet publish -r {RID} --no-self-contained -``` - -For a hosted Blazor WebAssembly app, use of the preceding command results in a runtime error because the options apply to all of the solution's projects unconditionally. This is a current limitation of the .NET CLI/MSBuild pipeline. To resolve the problem, adopt ***either*** of the following approaches: - -* Specify the options as MSBuild properties in the `dotnet publish` command: - - ```dotnetcli - dotnet publish /p:RuntimeIdentifier={RID} /p:SelfContained=false - ``` - -* Specify the options as MSBuild properties in the **`Server`** project's project file (`.csproj`): +* Configure the deployment for [self-contained](/dotnet/core/deploying/#publish-self-contained) by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml - {RID} false ``` + + > [!NOTE] + > The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + +* Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: + + * Option 1: Set the RID in the in the **`Server`** project's project file: + + ```xml + {RID} + ``` + + In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + + Publish the app in the Release configuration from the **`Server`** project: + + ```dotnetcli + dotnet publish -c Release + ``` + + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: + + ```dotnetcli + dotnet publish -c Release \p:RuntimeIdentifier={RID} + ``` + + In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). For more information, see [.NET application publishing overview](/dotnet/core/deploying/). @@ -1004,32 +1014,44 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: -## Use MSBuild properties for hosted deployment options that apply to all projects +## Hosted deployment of a framework-dependent executable for a specific platform -When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. - -The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). - -Normally, such a deployment is created with the following .NET CLI command that uses the runtime option (`-r|--runtime`) with the `--no-self-contained` option, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): - -```dotnetcli -dotnet publish -r {RID} --no-self-contained -``` +To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -For a hosted Blazor WebAssembly app, use of the preceding command results in a runtime error because the options apply to all of the solution's projects unconditionally. This is a current limitation of the .NET CLI/MSBuild pipeline. To resolve the problem, adopt ***either*** of the following approaches: - -* Specify the options as MSBuild properties in the `dotnet publish` command: - - ```dotnetcli - dotnet publish /p:RuntimeIdentifier={RID} /p:SelfContained=false - ``` - -* Specify the options as MSBuild properties in the **`Server`** project's project file (`.csproj`): +* Configure the deployment for [self-contained](/dotnet/core/deploying/#publish-self-contained) by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml - {RID} false ``` + + > [!NOTE] + > The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + +* Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: + + * Option 1: Set the RID in the in the **`Server`** project's project file: + + ```xml + {RID} + ``` + + In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + + Publish the app in the Release configuration from the **`Server`** project: + + ```dotnetcli + dotnet publish -c Release + ``` + + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: + + ```dotnetcli + dotnet publish -c Release \p:RuntimeIdentifier={RID} + ``` + + In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + +For more information, see [.NET application publishing overview](/dotnet/core/deploying/). ## Hosted deployment with multiple Blazor WebAssembly apps @@ -1709,32 +1731,44 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: -## Use MSBuild properties for hosted deployment options that apply to all projects - -When publishing a hosted Blazor WebAssembly app, some of the options passed to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) result in runtime errors because the option applies to all of the solution's projects unconditionally, both the **`Client`** and the **`Server`** projects in a hosted deployment. Options that exhibit this behavior must be specified using the MSBuild property in the `dotnet publish` command or specified in the **`Server`** project's project file to scope the property correctly. - -The [Runtime Identifier (RID)](/dotnet/core/rid-catalog) falls into this category of options. Consider the following example, where the developer plans to publish a hosted WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained). - -Normally, such a deployment is created with the following .NET CLI command that uses the runtime option (`-r|--runtime`) with the `--no-self-contained` option, where the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog): - -```dotnetcli -dotnet publish -r {RID} --no-self-contained -``` - -For a hosted Blazor WebAssembly app, use of the preceding command results in a runtime error because the options apply to all of the solution's projects unconditionally. This is a current limitation of the .NET CLI/MSBuild pipeline. To resolve the problem, adopt ***either*** of the following approaches: +## Hosted deployment of a framework-dependent executable for a specific platform -* Specify the options as MSBuild properties in the `dotnet publish` command: +To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): - ```dotnetcli - dotnet publish /p:RuntimeIdentifier={RID} /p:SelfContained=false - ``` - -* Specify the options as MSBuild properties in the **`Server`** project's project file (`.csproj`): +* Configure the deployment for [self-contained](/dotnet/core/deploying/#publish-self-contained) by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml - {RID} false ``` + + > [!NOTE] + > The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + +* Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: + + * Option 1: Set the RID in the in the **`Server`** project's project file: + + ```xml + {RID} + ``` + + In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + + Publish the app in the Release configuration from the **`Server`** project: + + ```dotnetcli + dotnet publish -c Release + ``` + + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: + + ```dotnetcli + dotnet publish -c Release \p:RuntimeIdentifier={RID} + ``` + + In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + +For more information, see [.NET application publishing overview](/dotnet/core/deploying/). ## Hosted deployment with multiple Blazor WebAssembly apps From 16764e2061de539e2a9d1f0c600785020cfa7cf6 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 4 Aug 2022 07:58:12 -0500 Subject: [PATCH 05/11] Updates --- aspnetcore/blazor/host-and-deploy/webassembly.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 7f9a4b2e2151..464750b990e2 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -179,7 +179,7 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure the deployment for [self-contained](/dotnet/core/deploying/#publish-self-contained) by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml false @@ -1018,7 +1018,7 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure the deployment for [self-contained](/dotnet/core/deploying/#publish-self-contained) by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml false @@ -1735,7 +1735,7 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure the deployment for [self-contained](/dotnet/core/deploying/#publish-self-contained) by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml false From 0821909126929fcc455662b3785d0ff90dd50536 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 4 Aug 2022 07:59:59 -0500 Subject: [PATCH 06/11] Updates --- aspnetcore/blazor/host-and-deploy/webassembly.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 464750b990e2..0f7770878d14 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -204,7 +204,7 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f dotnet publish -c Release ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: ```dotnetcli dotnet publish -c Release \p:RuntimeIdentifier={RID} @@ -1043,7 +1043,7 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f dotnet publish -c Release ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: ```dotnetcli dotnet publish -c Release \p:RuntimeIdentifier={RID} @@ -1760,7 +1760,7 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f dotnet publish -c Release ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: ```dotnetcli dotnet publish -c Release \p:RuntimeIdentifier={RID} From 91aff7915b97a508244dc4ff2384caf804f1538b Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 4 Aug 2022 08:12:15 -0500 Subject: [PATCH 07/11] Updates --- aspnetcore/blazor/host-and-deploy/webassembly.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 0f7770878d14..87e70a0600cd 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -207,7 +207,7 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: ```dotnetcli - dotnet publish -c Release \p:RuntimeIdentifier={RID} + dotnet publish -c Release /p:RuntimeIdentifier={RID} ``` In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). @@ -1046,7 +1046,7 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: ```dotnetcli - dotnet publish -c Release \p:RuntimeIdentifier={RID} + dotnet publish -c Release /p:RuntimeIdentifier={RID} ``` In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). @@ -1763,7 +1763,7 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: ```dotnetcli - dotnet publish -c Release \p:RuntimeIdentifier={RID} + dotnet publish -c Release /p:RuntimeIdentifier={RID} ``` In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). From 386cf92946033a149ad6578ef0fb738b6d8b86e1 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 4 Aug 2022 10:51:44 -0500 Subject: [PATCH 08/11] Updates --- .../blazor/host-and-deploy/webassembly.md | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 87e70a0600cd..23fe8d907d21 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -179,18 +179,18 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file or rely upon a Visual Studio publish profile (`.pubxml `) with the property set to `false` by default, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml false ``` > [!NOTE] - > The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. * Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: - * Option 1: Set the RID in the in the **`Server`** project's project file: + * Option 1: Set the RID in the in the **`Server`** project's project file or via a Visual Studio publish profile (`.pubxml`) **Target Runtime**: ```xml {RID} @@ -198,13 +198,17 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - Publish the app in the Release configuration from the **`Server`** project: + Publish the app in the Release configuration from the **`Server`** project or publish the app from Visual Studio in the **Release** configuration. + + Using the .NET CLI: ```dotnetcli dotnet publish -c Release ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project. + + Using the .NET CLI: ```dotnetcli dotnet publish -c Release /p:RuntimeIdentifier={RID} @@ -212,7 +216,10 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). -For more information, see [.NET application publishing overview](/dotnet/core/deploying/). +For more information, see the following articles: + +* [.NET application publishing overview](/dotnet/core/deploying/) +* ## Hosted deployment with multiple Blazor WebAssembly apps @@ -1018,18 +1025,18 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file or rely upon a Visual Studio publish profile (`.pubxml `) with the property set to `false` by default, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml false ``` > [!NOTE] - > The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. * Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: - * Option 1: Set the RID in the in the **`Server`** project's project file: + * Option 1: Set the RID in the in the **`Server`** project's project file or via a Visual Studio publish profile (`.pubxml`) **Target Runtime**: ```xml {RID} @@ -1037,13 +1044,17 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - Publish the app in the Release configuration from the **`Server`** project: + Publish the app in the Release configuration from the **`Server`** project or publish the app from Visual Studio in the **Release** configuration. + + Using the .NET CLI: ```dotnetcli dotnet publish -c Release ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project. + + Using the .NET CLI: ```dotnetcli dotnet publish -c Release /p:RuntimeIdentifier={RID} @@ -1051,7 +1062,10 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). -For more information, see [.NET application publishing overview](/dotnet/core/deploying/). +For more information, see the following articles: + +* [.NET application publishing overview](/dotnet/core/deploying/) +* ## Hosted deployment with multiple Blazor WebAssembly apps @@ -1735,18 +1749,18 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file or rely upon a Visual Studio publish profile (`.pubxml `) with the property set to `false` by default, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): ```xml false ``` > [!NOTE] - > The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. * Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: - * Option 1: Set the RID in the in the **`Server`** project's project file: + * Option 1: Set the RID in the in the **`Server`** project's project file or via a Visual Studio publish profile (`.pubxml`) **Target Runtime**: ```xml {RID} @@ -1754,13 +1768,17 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - Publish the app in the Release configuration from the **`Server`** project: + Publish the app in the Release configuration from the **`Server`** project or publish the app from Visual Studio in the **Release** configuration. + + Using the .NET CLI: ```dotnetcli dotnet publish -c Release ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project: + * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project. + + Using the .NET CLI: ```dotnetcli dotnet publish -c Release /p:RuntimeIdentifier={RID} @@ -1768,7 +1786,10 @@ To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable f In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). -For more information, see [.NET application publishing overview](/dotnet/core/deploying/). +For more information, see the following articles: + +* [.NET application publishing overview](/dotnet/core/deploying/) +* ## Hosted deployment with multiple Blazor WebAssembly apps From 31b3c08ddf4c830912b84581e75beffaa9de044d Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 4 Aug 2022 11:09:29 -0500 Subject: [PATCH 09/11] Updates --- .../blazor/host-and-deploy/webassembly.md | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 23fe8d907d21..4653fab87b14 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -179,14 +179,17 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file or rely upon a Visual Studio publish profile (`.pubxml `) with the property set to `false` by default, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment using either of the following approaches: + + * Place the `` MSBuild property in the **`Server`** project's project file set to `false`. + * Use a Visual Studio publish profile (`.pubxml `) with the property set to `false`, which is the default setting for a generated publish profile. ```xml false ``` - > [!NOTE] - > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + > [!IMPORTANT] + > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. * Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: @@ -1025,14 +1028,17 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file or rely upon a Visual Studio publish profile (`.pubxml `) with the property set to `false` by default, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment using either of the following approaches: + + * Place the `` MSBuild property in the **`Server`** project's project file set to `false`. + * Use a Visual Studio publish profile (`.pubxml `) with the property set to `false`, which is the default setting for a generated publish profile. ```xml false ``` - > [!NOTE] - > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + > [!IMPORTANT] + > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. * Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: @@ -1749,14 +1755,17 @@ For more information, see the following articles: To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in the **`Server`** project's project file or rely upon a Visual Studio publish profile (`.pubxml `) with the property set to `false` by default, ***not*** by passing the `--no-self-contained` option to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish): +* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment using either of the following approaches: + + * Place the `` MSBuild property in the **`Server`** project's project file set to `false`. + * Use a Visual Studio publish profile (`.pubxml `) with the property set to `false`, which is the default setting for a generated publish profile. ```xml false ``` - > [!NOTE] - > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be passed to the `dotnet publish` command as `/p:SelfContained=false`. + > [!IMPORTANT] + > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. * Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: From d237e269f5864d6fe283dec51fcb650141ccdac7 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Fri, 5 Aug 2022 05:44:41 -0500 Subject: [PATCH 10/11] Updates --- .../blazor/host-and-deploy/webassembly.md | 225 +++++++++++------- 1 file changed, 135 insertions(+), 90 deletions(-) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 4653fab87b14..a1e925abea27 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -177,47 +177,62 @@ For more information, see the following articles: ## Hosted deployment of a framework-dependent executable for a specific platform -To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): +To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained) use the following guidance based on the tooling in use. -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment using either of the following approaches: +### Visual Studio - * Place the `` MSBuild property in the **`Server`** project's project file set to `false`. - * Use a Visual Studio publish profile (`.pubxml `) with the property set to `false`, which is the default setting for a generated publish profile. +By default, a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment is configured for a generated publish profile (`.pubxml`). Confirm that the **`Server`** project's publish profile contains the `` MSBuild property set to `false`. - ```xml - false - ``` +In the `.pubxml` publish profile file in the **`Server`** project's `Properties` folder: + +```xml +false +``` + +Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using the **Target Runtime** setting in the **Settings** area of the **Publish** UI, which generates the `` MSBuild property in the publish profile: - > [!IMPORTANT] - > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. +```xml +{RID} +``` + +In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + +Publish the **`Server`** project in the **Release** configuration. + +### .NET CLI + +Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in a `` in the **`Server`** project's project file set to `false`: + +```xml +false +``` + +> [!IMPORTANT] +> The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. -* Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: +Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: - * Option 1: Set the RID in the in the **`Server`** project's project file or via a Visual Studio publish profile (`.pubxml`) **Target Runtime**: +* Option 1: Set the RID in a `` in the **`Server`** project's project file: - ```xml - {RID} - ``` - - In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - - Publish the app in the Release configuration from the **`Server`** project or publish the app from Visual Studio in the **Release** configuration. - - Using the .NET CLI: - - ```dotnetcli - dotnet publish -c Release - ``` + ```xml + {RID} + ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project. + In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - Using the .NET CLI: + Publish the app in the Release configuration from the **`Server`** project: + + ```dotnetcli + dotnet publish -c Release + ``` + +* Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: - ```dotnetcli - dotnet publish -c Release /p:RuntimeIdentifier={RID} - ``` + ```dotnetcli + dotnet publish -c Release /p:RuntimeIdentifier={RID} + ``` - In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). For more information, see the following articles: @@ -1026,47 +1041,62 @@ For more information, see the following articles: ## Hosted deployment of a framework-dependent executable for a specific platform -To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): +To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained) use the following guidance based on the tooling in use. -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment using either of the following approaches: +### Visual Studio - * Place the `` MSBuild property in the **`Server`** project's project file set to `false`. - * Use a Visual Studio publish profile (`.pubxml `) with the property set to `false`, which is the default setting for a generated publish profile. +By default, a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment is configured for a generated publish profile (`.pubxml`). Confirm that the **`Server`** project's publish profile contains the `` MSBuild property set to `false`. - ```xml - false - ``` +In the `.pubxml` publish profile file in the **`Server`** project's `Properties` folder: + +```xml +false +``` + +Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using the **Target Runtime** setting in the **Settings** area of the **Publish** UI, which generates the `` MSBuild property in the publish profile: - > [!IMPORTANT] - > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. +```xml +{RID} +``` + +In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + +Publish the **`Server`** project in the **Release** configuration. + +### .NET CLI + +Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in a `` in the **`Server`** project's project file set to `false`: + +```xml +false +``` + +> [!IMPORTANT] +> The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. -* Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: +Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: - * Option 1: Set the RID in the in the **`Server`** project's project file or via a Visual Studio publish profile (`.pubxml`) **Target Runtime**: +* Option 1: Set the RID in a `` in the **`Server`** project's project file: - ```xml - {RID} - ``` - - In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - - Publish the app in the Release configuration from the **`Server`** project or publish the app from Visual Studio in the **Release** configuration. - - Using the .NET CLI: - - ```dotnetcli - dotnet publish -c Release - ``` + ```xml + {RID} + ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project. + In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - Using the .NET CLI: + Publish the app in the Release configuration from the **`Server`** project: + + ```dotnetcli + dotnet publish -c Release + ``` + +* Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: - ```dotnetcli - dotnet publish -c Release /p:RuntimeIdentifier={RID} - ``` + ```dotnetcli + dotnet publish -c Release /p:RuntimeIdentifier={RID} + ``` - In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). For more information, see the following articles: @@ -1753,47 +1783,62 @@ For more information, see the following articles: ## Hosted deployment of a framework-dependent executable for a specific platform -To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained): +To deploy a hosted Blazor WebAssembly app as a [framework-dependent executable for a specific platform](/dotnet/core/deploying/#publish-framework-dependent) (not self-contained) use the following guidance based on the tooling in use. -* Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment using either of the following approaches: +### Visual Studio - * Place the `` MSBuild property in the **`Server`** project's project file set to `false`. - * Use a Visual Studio publish profile (`.pubxml `) with the property set to `false`, which is the default setting for a generated publish profile. +By default, a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment is configured for a generated publish profile (`.pubxml`). Confirm that the **`Server`** project's publish profile contains the `` MSBuild property set to `false`. - ```xml - false - ``` +In the `.pubxml` publish profile file in the **`Server`** project's `Properties` folder: + +```xml +false +``` + +Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using the **Target Runtime** setting in the **Settings** area of the **Publish** UI, which generates the `` MSBuild property in the publish profile: - > [!IMPORTANT] - > The `SelfContained` property must be placed in the **`Server`** project's project file or the Visual Studio publish profile. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. +```xml +{RID} +``` + +In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + +Publish the **`Server`** project in the **Release** configuration. + +### .NET CLI + +Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in a `` in the **`Server`** project's project file set to `false`: + +```xml +false +``` + +> [!IMPORTANT] +> The `SelfContained` property must be placed in the **`Server`** project's project file. The property can't be set correctly with the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) using the `--no-self-contained` option or the MSBuild property `/p:SelfContained=false`. -* Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: +Set the [Runtime Identifier (RID)](/dotnet/core/rid-catalog) using ***either*** of the following approaches: - * Option 1: Set the RID in the in the **`Server`** project's project file or via a Visual Studio publish profile (`.pubxml`) **Target Runtime**: +* Option 1: Set the RID in a `` in the **`Server`** project's project file: - ```xml - {RID} - ``` - - In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - - Publish the app in the Release configuration from the **`Server`** project or publish the app from Visual Studio in the **Release** configuration. - - Using the .NET CLI: - - ```dotnetcli - dotnet publish -c Release - ``` + ```xml + {RID} + ``` - * Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option. Publish the app from the **`Server`** project. + In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). - Using the .NET CLI: + Publish the app in the Release configuration from the **`Server`** project: + + ```dotnetcli + dotnet publish -c Release + ``` + +* Option 2: Pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) as the MSBuild property (`/p:RuntimeIdentifier`), ***not*** with the `-r|--runtime` option: - ```dotnetcli - dotnet publish -c Release /p:RuntimeIdentifier={RID} - ``` + ```dotnetcli + dotnet publish -c Release /p:RuntimeIdentifier={RID} + ``` - In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). + In the preceding command, the `{RID}` placeholder is the [Runtime Identifier (RID)](/dotnet/core/rid-catalog). For more information, see the following articles: From 2b0938bdbb3f11be6026bdba59a4ce073b19230d Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Fri, 5 Aug 2022 05:55:29 -0500 Subject: [PATCH 11/11] Updates --- aspnetcore/blazor/host-and-deploy/webassembly.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index a1e925abea27..738c2d528b44 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -199,6 +199,9 @@ In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifi Publish the **`Server`** project in the **Release** configuration. +> [!NOTE] +> It's possible to publish an app with publish profile settings using the .NET CLI by passing `/p:PublishProfile={PROFILE}` to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish), where the `{PROFILE}` placeholder is the profile. For more information, see the *Publish profiles* and *Folder publish example* sections in the article. If you pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) and not in the publish profile, use the MSBuild property (`/p:RuntimeIdentifier`) with the command, ***not*** with the `-r|--runtime` option. + ### .NET CLI Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in a `` in the **`Server`** project's project file set to `false`: @@ -1063,6 +1066,9 @@ In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifi Publish the **`Server`** project in the **Release** configuration. +> [!NOTE] +> It's possible to publish an app with publish profile settings using the .NET CLI by passing `/p:PublishProfile={PROFILE}` to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish), where the `{PROFILE}` placeholder is the profile. For more information, see the *Publish profiles* and *Folder publish example* sections in the article. If you pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) and not in the publish profile, use the MSBuild property (`/p:RuntimeIdentifier`) with the command, ***not*** with the `-r|--runtime` option. + ### .NET CLI Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in a `` in the **`Server`** project's project file set to `false`: @@ -1805,6 +1811,9 @@ In the preceding configuration, the `{RID}` placeholder is the [Runtime Identifi Publish the **`Server`** project in the **Release** configuration. +> [!NOTE] +> It's possible to publish an app with publish profile settings using the .NET CLI by passing `/p:PublishProfile={PROFILE}` to the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish), where the `{PROFILE}` placeholder is the profile. For more information, see the *Publish profiles* and *Folder publish example* sections in the article. If you pass the RID in the [`dotnet publish` command](/dotnet/core/tools/dotnet-publish) and not in the publish profile, use the MSBuild property (`/p:RuntimeIdentifier`) with the command, ***not*** with the `-r|--runtime` option. + ### .NET CLI Configure a [self-contained](/dotnet/core/deploying/#publish-self-contained) deployment by placing the `` MSBuild property in a `` in the **`Server`** project's project file set to `false`: