diff --git a/aspnetcore/blazor/host-and-deploy/webassembly.md b/aspnetcore/blazor/host-and-deploy/webassembly.md index 7b99e1262851..738c2d528b44 100644 --- a/aspnetcore/blazor/host-and-deploy/webassembly.md +++ b/aspnetcore/blazor/host-and-deploy/webassembly.md @@ -175,6 +175,73 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: +## 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) use the following guidance based on the tooling in use. + +### Visual Studio + +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`. + +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: + +```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. + +> [!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`: + +```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: + +* 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: + + ```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 the following articles: + +* [.NET application publishing overview](/dotnet/core/deploying/) +* + ## Hosted deployment with multiple Blazor WebAssembly apps For more information, see . @@ -975,6 +1042,73 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: +## 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) use the following guidance based on the tooling in use. + +### Visual Studio + +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`. + +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: + +```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. + +> [!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`: + +```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: + +* 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: + + ```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 the following articles: + +* [.NET application publishing overview](/dotnet/core/deploying/) +* + ## Hosted deployment with multiple Blazor WebAssembly apps For more information, see . @@ -1653,6 +1787,73 @@ For more information, see the following articles: * Deployment to Azure App Service: * Blazor project templates: +## 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) use the following guidance based on the tooling in use. + +### Visual Studio + +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`. + +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: + +```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. + +> [!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`: + +```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: + +* 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: + + ```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 the following articles: + +* [.NET application publishing overview](/dotnet/core/deploying/) +* + ## Hosted deployment with multiple Blazor WebAssembly apps For more information, see .