diff --git a/docs/TOC.yml b/docs/TOC.yml index 4c34009779..f34af0b85d 100644 --- a/docs/TOC.yml +++ b/docs/TOC.yml @@ -788,8 +788,10 @@ items: - name: Overview href: windows/deployment/overview.md - - name: Publish with the .NET CLI + - name: Publish a packaged app with the .NET CLI href: windows/deployment/publish-cli.md + - name: Publish an unpackaged app with the .NET CLI + href: windows/deployment/publish-unpackaged-cli.md - name: Publish with Visual Studio to a folder href: windows/deployment/publish-visual-studio-folder.md - name: Troubleshooting diff --git a/docs/android/deployment/index.md b/docs/android/deployment/index.md index 310d2686f8..e1a9b6aeed 100644 --- a/docs/android/deployment/index.md +++ b/docs/android/deployment/index.md @@ -8,10 +8,9 @@ ms.date: 04/05/2023 > [!div class="op_single_selector"] > -> - [Publish for Android](index.md) -> - [Publish for iOS](../../ios/deployment/index.md) -> - [Publish for macOS](../../mac-catalyst/deployment/index.md) -> - [Publish for Windows](../../windows/deployment/overview.md) +> - [Publish for Google Play distribution](publish-google-play.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) +> - [Publish using the command line](publish-cli.md) The final step in the development of a .NET Multi-platform App UI (.NET MAUI) app is to publish it. Publishing is the process of creating a package that contains the app and is ready for users to install on their devices. Publishing involve two essential tasks: diff --git a/docs/android/deployment/publish-ad-hoc.md b/docs/android/deployment/publish-ad-hoc.md index 163335c933..09a5631168 100644 --- a/docs/android/deployment/publish-ad-hoc.md +++ b/docs/android/deployment/publish-ad-hoc.md @@ -6,6 +6,11 @@ ms.date: 05/15/2023 # Publish an Android app for ad-hoc distribution +> [!div class="op_single_selector"] +> +> - [Publish for Google Play distribution](publish-google-play.md) +> - [Publish using the command line](publish-cli.md) + When distributing Android apps outside Google Play, and other marketplaces, *ad-hoc* distribution enables you to make the app available for download on a website or server. Android requires that apps created for ad-hoc distribution use the Android Package (APK) format. To distribute a .NET Multi-platform App UI (.NET MAUI) Android app, you'll need to sign it with a key from your keystore. Keystores are binary files that serve as repositories of certificates and private keys. diff --git a/docs/android/deployment/publish-cli.md b/docs/android/deployment/publish-cli.md index dc33f634cc..9d93ed7e3d 100644 --- a/docs/android/deployment/publish-cli.md +++ b/docs/android/deployment/publish-cli.md @@ -6,6 +6,11 @@ ms.date: 05/16/2023 # Publish an Android app using the command line +> [!div class="op_single_selector"] +> +> - [Publish for Google Play distribution](publish-google-play.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) + To distribute a .NET Multi-platform App UI (.NET MAUI) Android app, you'll need to sign it with a key from your keystore. A *keystore* is a database of security certificates that's created by using `keytool` from the Java Development Kit (JDK). A keystore is required when publishing a .NET MAUI Android app, as Android won't run apps that haven't been signed. ## Create a keystore file diff --git a/docs/android/deployment/publish-google-play.md b/docs/android/deployment/publish-google-play.md index cb9a91bd3b..319f7b0067 100644 --- a/docs/android/deployment/publish-google-play.md +++ b/docs/android/deployment/publish-google-play.md @@ -6,6 +6,11 @@ ms.date: 05/15/2023 # Publish an Android app for Google Play distribution +> [!div class="op_single_selector"] +> +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) +> - [Publish using the command line](publish-cli.md) + The most common approach to distributing Android apps to users is through the Google Play. The first time an app is submitted to Google Play it must be submitted through the Google Play Console. Subsequent versions of the app can be submitted through Visual Studio. In both cases, a Google Play Developer account is required. Apps submitted to Google Play require approval from Google. To distribute a .NET Multi-platform App UI (.NET MAUI) Android app, you'll need to sign it with a key from your keystore, prior to upload to Google Play. Keystores are binary files that serve as repositories of certificates and private keys. diff --git a/docs/ios/deployment/index.md b/docs/ios/deployment/index.md index e83b1e811f..fc3a526b63 100644 --- a/docs/ios/deployment/index.md +++ b/docs/ios/deployment/index.md @@ -8,10 +8,10 @@ ms.date: 02/24/2023 > [!div class="op_single_selector"] > -> - [Publish for Android](../../android/deployment/index.md) -> - [Publish for iOS](index.md) -> - [Publish for macOS](../../mac-catalyst/deployment/index.md) -> - [Publish for Windows](../../windows/deployment/overview.md) +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish for in-house distribution](publish-in-house.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) +> - [Publish using the command line](publish-cli.md) Once a .NET Multi-platform App UI (.NET MAUI) iOS app has been developed and tested, it can be packaged for distribution as an *.ipa* file. An *.ipa* file is an iOS app archive file that stores an iOS app. The following diagram shows the steps required to produce the app package for distribution: diff --git a/docs/ios/deployment/publish-ad-hoc.md b/docs/ios/deployment/publish-ad-hoc.md index 4ff2f984d4..5ff57e59d6 100644 --- a/docs/ios/deployment/publish-ad-hoc.md +++ b/docs/ios/deployment/publish-ad-hoc.md @@ -6,6 +6,12 @@ ms.date: 02/24/2023 # Publish an iOS app for ad-hoc distribution +> [!div class="op_single_selector"] +> +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish for in-house distribution](publish-in-house.md) +> - [Publish using the command line](publish-cli.md) + Ad-hoc distribution is primarily used for testing apps within a wide group of people, and is available for the Apple Developer Program and the Apple Developer Enterprise Program. Another use case for ad-hoc distribution is distribution within a company when App Store Connect isn't an option. Ad-hoc distribution has the advantage of not requiring App Store approval, with apps being installed with [Apple Configurator](https://apps.apple.com/app/id1037126344). However, it's limited to 100 devices per membership year, for both development and distribution, and the devices must be added to your Apple Developer Account. diff --git a/docs/ios/deployment/publish-app-store.md b/docs/ios/deployment/publish-app-store.md index 4dbbecd627..c345d3f7f9 100644 --- a/docs/ios/deployment/publish-app-store.md +++ b/docs/ios/deployment/publish-app-store.md @@ -6,6 +6,12 @@ ms.date: 02/24/2023 # Publish an iOS app for App Store distribution +> [!div class="op_single_selector"] +> +> - [Publish for in-house distribution](publish-in-house.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) +> - [Publish using the command line](publish-cli.md) + The most common approach to distributing iOS apps to users is through the App Store. Apps are submitted to the App Store through an online tool called *App Store Connect*. Only developers who belong to the Apple Developer Program have access to this tool. Members of the Apple Developer Enterprise Program do not have access. All apps submitted to the App Store require approval from Apple. Distributing an iOS app requires that the app is provisioned using a *provisioning profile*. Provisioning profiles are files that contain code signing information, as well as the identity of the app and its intended distribution mechanism. diff --git a/docs/ios/deployment/publish-cli.md b/docs/ios/deployment/publish-cli.md index 5276f8273d..b13cbdc76b 100644 --- a/docs/ios/deployment/publish-cli.md +++ b/docs/ios/deployment/publish-cli.md @@ -6,6 +6,12 @@ ms.date: 02/24/2023 # Publish an iOS app using the command line +> [!div class="op_single_selector"] +> +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish for in-house distribution](publish-in-house.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) + To publish your app from the command line on a Mac, open a terminal and navigate to the folder for your .NET Multi-platform App UI (.NET MAUI) app project. Run the `dotnet publish` command, providing the following parameters: | Parameter | Value | diff --git a/docs/ios/deployment/publish-in-house.md b/docs/ios/deployment/publish-in-house.md index 6b06ca950a..0b98be3138 100644 --- a/docs/ios/deployment/publish-in-house.md +++ b/docs/ios/deployment/publish-in-house.md @@ -6,6 +6,12 @@ ms.date: 02/24/2023 # Publish an iOS app for in-house distribution +> [!div class="op_single_selector"] +> +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) +> - [Publish using the command line](publish-cli.md) + In-house distribution enables members of the Apple Developer Enterprise Program to distribute apps internally to other members of the same organization. This has the advantage of not requiring an App Store review, and having no limit on the number of devices on which an app can be installed. However, members of the Apple Developer Enterprise Program don't have access to App Store Connect, and therefore the licensee is responsible for distributing the app. Distributing an iOS app requires that the app is provisioned using a *provisioning profile*. Provisioning profiles are files that contain code signing information, as well as the identity of the app and its intended distribution mechanism. diff --git a/docs/mac-catalyst/deployment/index.md b/docs/mac-catalyst/deployment/index.md index a5285fe2bf..3543bd5e38 100644 --- a/docs/mac-catalyst/deployment/index.md +++ b/docs/mac-catalyst/deployment/index.md @@ -8,10 +8,10 @@ ms.date: 03/23/2023 > [!div class="op_single_selector"] > -> - [Publish for Android](../../android/deployment/index.md) -> - [Publish for iOS](../../ios/deployment/index.md -> - [Publish for macOS](index.md) -> - [Publish for Windows](../../windows/deployment/overview.md) +> - [Publish an unsigned app](publish-unsigned.md) +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish outside the app store](publish-outside-app-store.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) Once a .NET Multi-platform App UI (.NET MAUI) Mac Catalyst app has been developed and tested, it can be packaged for distribution as an *.app* or a *.pkg* file. An *.app* file is a self-contained app that can be run without installation, whereas a *.pkg* is an app packaged in an installer. The following diagram shows the steps required to produce an app package for distribution: diff --git a/docs/mac-catalyst/deployment/publish-ad-hoc.md b/docs/mac-catalyst/deployment/publish-ad-hoc.md index e415b54d3a..30f7023c2e 100644 --- a/docs/mac-catalyst/deployment/publish-ad-hoc.md +++ b/docs/mac-catalyst/deployment/publish-ad-hoc.md @@ -6,6 +6,12 @@ ms.date: 03/20/2023 # Publish a Mac Catalyst app for ad-hoc distribution +> [!div class="op_single_selector"] +> +> - [Publish an unsigned app](publish-unsigned.md) +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish outside the app store](publish-outside-app-store.md) + When distributing Mac Catalyst apps outside the Mac App Store, you can also choose to distribute your app to a limited number of users on registered devices. This is known as *ad-hoc* distribution, and is primarily used for testing apps within a group of people. However, it's limited to 100 devices per membership year, and the devices must be added to your Apple Developer Account. Members of the Apple Developer Program and the Apple Developer Enterprise Program can use this distribution approach. Distributing a Mac Catalyst app requires that the app is provisioned using a *provisioning profile*. Provisioning profiles are files that contain code signing information, as well as the identity of the app and its intended distribution mechanism. diff --git a/docs/mac-catalyst/deployment/publish-app-store.md b/docs/mac-catalyst/deployment/publish-app-store.md index 6cb87ce64c..0130707b11 100644 --- a/docs/mac-catalyst/deployment/publish-app-store.md +++ b/docs/mac-catalyst/deployment/publish-app-store.md @@ -6,6 +6,12 @@ ms.date: 03/23/2023 # Publish a Mac Catalyst app for Mac App Store distribution +> [!div class="op_single_selector"] +> +> - [Publish an unsigned app](publish-unsigned.md) +> - [Publish outside the app store](publish-outside-app-store.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) + The most common approach to distributing Mac Catalyst apps to users is through the Mac App Store. Apps are submitted to the Mac App Store through an online tool called *App Store Connect*. Only developers who belong to the Apple Developer Program have access to this tool. Members of the Apple Developer Enterprise Program do not have access. All apps submitted to the Mac App Store require approval from Apple. Distributing a Mac Catalyst app requires that the app is provisioned using a *provisioning profile*. Provisioning profiles are files that contain code signing information, as well as the identity of the app and its intended distribution mechanism. diff --git a/docs/mac-catalyst/deployment/publish-outside-app-store.md b/docs/mac-catalyst/deployment/publish-outside-app-store.md index 6cf2c73878..4576fff069 100644 --- a/docs/mac-catalyst/deployment/publish-outside-app-store.md +++ b/docs/mac-catalyst/deployment/publish-outside-app-store.md @@ -6,6 +6,12 @@ ms.date: 03/23/2023 # Publish a Mac Catalyst app for distribution outside the Mac App Store +> [!div class="op_single_selector"] +> +> - [Publish an unsigned app](publish-unsigned.md) +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) + An alternative to distributing Mac Catalyst apps through the Mac App Store is to distribute them outside the Mac App Store. With this approach, your Mac Catalyst app can be hosted at a location of your choosing for download. Members of the Apple Developer Program and the Apple Developer Enterprise Program can use this distribution approach. Distributing a Mac Catalyst app requires that the app is provisioned using a *provisioning profile*. Provisioning profiles are files that contain code signing information, as well as the identity of the app and its intended distribution mechanism. diff --git a/docs/mac-catalyst/deployment/publish-unsigned.md b/docs/mac-catalyst/deployment/publish-unsigned.md index 3a515c2c80..36d3d3a3e2 100644 --- a/docs/mac-catalyst/deployment/publish-unsigned.md +++ b/docs/mac-catalyst/deployment/publish-unsigned.md @@ -6,6 +6,12 @@ ms.date: 03/23/2023 # Publish an unsigned .NET MAUI Mac Catalyst app +> [!div class="op_single_selector"] +> +> - [Publish for app store distribution](publish-app-store.md) +> - [Publish outside the app store](publish-outside-app-store.md) +> - [Publish for ad-hoc distribution](publish-ad-hoc.md) + To publish an unsigned .NET Multi-platform App UI (.NET MAUI) Mac Catalyst app, open a terminal and navigate to the folder for your app project. Run the `dotnet publish` command, providing the following parameters: | Parameter | Value | diff --git a/docs/windows/deployment/overview.md b/docs/windows/deployment/overview.md index 81eb6c8f79..88b3920d18 100644 --- a/docs/windows/deployment/overview.md +++ b/docs/windows/deployment/overview.md @@ -1,26 +1,23 @@ --- title: "Publish a .NET MAUI app for Windows" description: "Learn how to package and publish a Windows .NET MAUI app." -ms.date: 10/12/2022 +ms.date: 11/08/2023 --- # Publish a .NET MAUI app for Windows > [!div class="op_single_selector"] > -> - [Publish for Android](../../android/deployment/index.md) -> - [Publish for iOS](../../ios/deployment/index.md) -> - [Publish for macOS](../../mac-catalyst/deployment/index.md) -> - [Publish for Windows](overview.md) +> - [Publish a packaged app using the command line](publish-cli.md) +> - [Publish an unpackaged app using the command line](publish-unpackaged-cli.md) +> - [Publish a packaged app using Visual Studio](publish-visual-studio-folder.md) -When distributing your .NET Multi-platform App UI (.NET MAUI) app for Windows, you can publish the app and its dependencies to a folder for deployment to another system. Publishing a .NET MAUI app for Windows creates an MSIX app package, which has numerous benefits for the users installing your app. For more information about the benefits of MSIX, see [What is MSIX?](/windows/msix/overview). - -.NET MAUI currently only allows publishing an MSIX package. You can't yet publish a Windows executable file for distribution. +When distributing your .NET Multi-platform App UI (.NET MAUI) app for Windows, you can publish the app and its dependencies to a folder for deployment to another system. Publishing a .NET MAUI app for Windows involves creating an MSIX app package (known as a *packaged* app), or creating an executable file (known as an *unpackaged* app). For more information about the benefits of MSIX, see [What is MSIX?](/windows/msix/overview). > [!IMPORTANT] > Blazor Hybrid apps require a WebView on the host platform. For more information, see [Keep the Web View current in deployed Blazor Hybrid apps](/aspnet/core/blazor/hybrid/security/security-considerations#keep-the-web-view-current-in-deployed-apps). -## Configuration +## MSIX package configuration The MSIX package is configured by the _Platforms\\Windows\\Package.appxmanifest_ (the manifest) file in your project. The manifest is used by the MSIX installer, the Microsoft store, and by Windows, to configure and display your app. .NET MAUI does use some shared settings across platforms, such as the app name and icon, which is set in the manifest at build-time. Besides those few settings, you'll need to edit the manifest to configure the app package to create a nice installer experience. The Microsoft Store has its own requirements, set in the manifest, when submitting your app. @@ -37,7 +34,3 @@ For more information on specific app manifest settings, see [App manifest schema ## Publish your app .NET MAUI can use Visual Studio for publishing, but also supports publishing through the `dotnet` command-line interface (CLI) for Continuous Integration (CI) scenarios. - - -- [Publish to a folder with Visual Studio](publish-visual-studio-folder.md) -- [Publish to a folder with the CLI](publish-cli.md) diff --git a/docs/windows/deployment/publish-cli.md b/docs/windows/deployment/publish-cli.md index fd5261c64b..46e4de6df8 100644 --- a/docs/windows/deployment/publish-cli.md +++ b/docs/windows/deployment/publish-cli.md @@ -1,22 +1,18 @@ --- -title: "Use the CLI to publish for Windows" -description: "Learn how to package and publish a Windows .NET MAUI app with the dotnet publish command." +title: "Use the CLI to publish packageds app for Windows" +description: "Learn how to package and publish a packaged Windows .NET MAUI app with the dotnet publish command." ms.date: 10/12/2022 --- -# Publish a .NET MAUI app for Windows with the CLI +# Publish a packaged .NET MAUI app for Windows with the CLI > [!div class="op_single_selector"] > -> - [Publish for Android](../../android/deployment/publish-cli.md) -> - [Publish for iOS](../../ios/deployment/index.md) -> - [Publish for macOS](../../mac-catalyst/deployment/index.md) -> - [Publish for Windows](publish-cli.md) +> - [Publish an unpackaged app using the command line](publish-unpackaged-cli.md) +> - [Publish a packaged app using Visual Studio](publish-visual-studio-folder.md) When distributing your .NET Multi-platform App UI (.NET MAUI) app for Windows, you can publish the app and its dependencies to a folder for deployment to another system. You can also package the app into an MSIX package, which has numerous benefits for the users installing your app. For more information about the benefits of MSIX, see [What is MSIX?](/windows/msix/overview) -.NET MAUI currently only allows publishing an MSIX package. You can't yet publish a Windows executable file for distribution. - ## Create a signing certificate You must use a signing certificate for use in publishing your app. This certificate is used to sign the MSIX package. The following steps demonstrate how to create and install a self-signed certificate with PowerShell: @@ -105,7 +101,7 @@ Add the following `` node to your project file. This property gro Replace the `` property value with the certificate thumbprint you previously generated. Alternatively, you can remove this setting from the project file and provide it on the command line. For example: `-p:PackageCertificateThumbprint=A10612AF095FD8F8255F4C6691D88F79EF2B135E`. -The second `` in the example is required to work around a bug in the Windows SDK. For more information about the bug, see [WindowsAppSDK Issue #2940](https://github.com/microsoft/WindowsAppSDK/issues/2940). +The second `` in the example is required to work around a bug in the Windows SDK. For more information about the bug, see [WindowsAppSDK Issue #3337](https://github.com/microsoft/WindowsAppSDK/issues/3337). ## Publish @@ -115,7 +111,7 @@ To publish your app, open the **Developer Command Prompt for VS 2022** terminal |------------------------------|-------------------------------------------------------------------------------------| | `-f` | The target framework, which is `net7.0-windows{version}`. This value is a Windows TFM, such as `net7.0-windows10.0.19041.0`. Ensure that this value is identical to the value in the `` node in your *.csproj* file. | | `-c` | The build configuration, which is `Release`. | -| `-p:RuntimeIdentifierOverride=win10-x64`
- or -
`-p:RuntimeIdentifierOverride=win10-x86` | Avoids the bug detailed in [WindowsAppSDK Issue #2940](https://github.com/microsoft/WindowsAppSDK/issues/2940). Choose the `-x64` or `-x86` version of the parameter based on your target platform. +| `-p:RuntimeIdentifierOverride=win10-x64`
- or -
`-p:RuntimeIdentifierOverride=win10-x86` | Avoids the bug detailed in [WindowsAppSDK Issue #3337](https://github.com/microsoft/WindowsAppSDK/issues/3337). Choose the `-x64` or `-x86` version of the parameter based on your target platform. > [!WARNING] > Attempting to publish a .NET MAUI solution will result in the `dotnet publish` command attempting to publish each project in the solution individually, which can cause issues when you've added other project types to your solution. Therefore, the `dotnet publish` command should be scoped to your .NET MAUI app project. diff --git a/docs/windows/deployment/publish-unpackaged-cli.md b/docs/windows/deployment/publish-unpackaged-cli.md new file mode 100644 index 0000000000..7580c181aa --- /dev/null +++ b/docs/windows/deployment/publish-unpackaged-cli.md @@ -0,0 +1,59 @@ +--- +title: "Use the CLI to publish unpackaged apps for Windows" +description: "Learn how to package and publish an unpackaged Windows .NET MAUI app with the dotnet publish command." +ms.date: 11/08/2023 +monikerRange: ">=net-maui-8.0" +--- + +# Publish an unpackaged .NET MAUI app for Windows with the CLI + +> [!div class="op_single_selector"] +> +> - [Publish a packaged app using the command line](publish-cli.md) +> - [Publish a packaged app using Visual Studio](publish-visual-studio-folder.md) + +When distributing your .NET Multi-platform App UI (.NET MAUI) app for Windows, you can publish the app and its dependencies to a folder for deployment to another system. + +## Configure the project build settings + +Add the following `` node to your project file. This property group is only processed when the target framework is Windows and the configuration is set to `Release`. This config section runs whenever a build or publish in `Release` mode. + +```xml + + $(RuntimeIdentifierOverride) + +``` + +The `` in the example is required to work around a bug in the Windows App SDK. For more information about the bug, see [WindowsAppSDK Issue #3337](https://github.com/microsoft/WindowsAppSDK/issues/3337). + +## Publish + +To publish your app, open the **Developer Command Prompt for VS 2022** terminal and navigate to the folder for your .NET MAUI app project. Run the `dotnet publish` command, providing the following parameters: + +| Parameter | Value | +|------------------------------|-------------------------------------------------------------------------------------| +| `-f` | The target framework, which is `net8.0-windows{version}`. This value is a Windows TFM, such as `net8.0-windows10.0.19041.0`. Ensure that this value is identical to the value in the `` node in your *.csproj* file. | +| `-c` | The build configuration, which is `Release`. | +| `-p:WindowsPackageType=None` | Indicates to the publish command that there should be no package. | +| `-p:RuntimeIdentifierOverride=win10-x64`
- or -
`-p:RuntimeIdentifierOverride=win10-x86` | Avoids the bug detailed in [WindowsAppSDK Issue #3337](https://github.com/microsoft/WindowsAppSDK/issues/3337). Choose the `-x64` or `-x86` version of the parameter based on your target platform. | +| `-p:WindowsPackageType` | The package type, which is `None` for unpackaged apps. | +| `-p:WindowsAppSDKSelfContained` | The deployment mode for your app, which can be framework-dependent or self-contained. This value should be `true` for self-contained apps. For more information about framework-dependent apps and self-contained apps, see [Windows App SDK deployment overview](/windows/apps/package-and-deploy/deploy-overview). | + +> [!WARNING] +> Attempting to publish a .NET MAUI solution will result in the `dotnet publish` command attempting to publish each project in the solution individually, which can cause issues when you've added other project types to your solution. Therefore, the `dotnet publish` command should be scoped to your .NET MAUI app project. + +For example: + +```console +dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None +``` + +Publishing builds the app, copying the executable to the _bin\\Release\\net8.0-windows10.0.19041.0\\win10-x64\\publish_ folder. In this folder, there's an _exe_ file, and that's the built app. This app can be launched or the entire folder can be copied to another machine and launched there. + +An important distinction from a packaged app is that this won't include the .NET runtime in the folder. This means that the app will require the .NET runtime to first be installed on the machines that will eventually run the app. To ensure the app also contains all the runtime components, the `-p:WindowsAppSDKSelfContained` argument can be provided when publishing. For example: + +```console +dotnet publish -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true +``` + +For more information about the `dotnet publish` command, see [dotnet publish](/dotnet/core/tools/dotnet-publish). diff --git a/docs/windows/deployment/publish-visual-studio-folder.md b/docs/windows/deployment/publish-visual-studio-folder.md index bcd24686a1..cad9a5d452 100644 --- a/docs/windows/deployment/publish-visual-studio-folder.md +++ b/docs/windows/deployment/publish-visual-studio-folder.md @@ -6,17 +6,12 @@ ms.date: 10/06/2022 # Publish a .NET MAUI app for Windows with Visual Studio - +> - [Publish a packaged app using the command line](publish-cli.md) +> - [Publish an unpackaged app using the command line](publish-unpackaged-cli.md) -This article describes how to use Visual Studio to publish your .NET MAUI app for Windows. .NET MAUI apps are packaged into an MSIX package, which is used for installing in Windows or for submission to the Microsoft Store. For more information about the benefits of MSIX, see [What is MSIX?](/windows/msix/overview). - -> [!TIP] -> .NET MAUI currently only allows publishing an MSIX package. You can't yet publish a Windows executable file for distribution. +This article describes how to use Visual Studio to publish your .NET MAUI app for Windows. .NET MAUI apps can be packaged into an MSIX package, which is used for installing in Windows or for submission to the Microsoft Store. For more information about the benefits of MSIX, see [What is MSIX?](/windows/msix/overview). ## Set the build target