-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Unpackaged apps by default on Win. * Edit. * Edit. * Edit. * Edits. * Fix linting error. * Fix identation. * Edit. * Fix moniker range. * Add image.
- Loading branch information
1 parent
2f5df77
commit 86fa5c5
Showing
10 changed files
with
138 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
ms.topic: include | ||
ms.date: 11/07/2024 | ||
--- | ||
|
||
## Configure Windows for packaged app deployment | ||
|
||
You'll need to enable Developer Mode in Windows to be able to deploy a packaged .NET MAUI Windows app. Both Windows 10 and Windows 11 are supported. | ||
|
||
:::image type="content" source="../media/setup/developer-mode-win11.png" alt-text="Developer mode settings in Windows 11 for MAUI .NET Windows app."::: | ||
|
||
### Windows 11 | ||
|
||
Developer Mode is enabled in **Settings** app, under **Privacy & security** > **For developers**. To enable Developer Mode in Windows 11: | ||
|
||
01. Open the Start Menu. | ||
01. Type **Developer settings** in the search box and select it. | ||
01. Turn on **Developer Mode**. | ||
01. If you receive a warning message about Developer Mode, read it, and select **Yes** if you understand the warning. | ||
|
||
### Windows 10 | ||
|
||
Developer Mode is enabled in **Settings** app, under **Update & Security** > **For developers**. To enable Developer Mode in Windows 10: | ||
|
||
01. Open the Start Menu. | ||
01. Search for **Developer settings**, select it. | ||
01. Turn on **Developer Mode**. | ||
01. If you receive a warning message about Developer Mode, read it, and select **Yes** if you understand the warning. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
ms.topic: include | ||
ms.date: 11/07/2024 | ||
--- | ||
|
||
## Convert a packaged .NET MAUI Windows app to unpackaged | ||
|
||
To convert an existing .NET MAUI Windows packaged app to an unpackaged app in Visual Studio: | ||
|
||
1. In **Solution Explorer**, right-click on your .NET MAUI app project and select **Properties**. Then, navigate to the **Application > Windows Targets** tab and ensure that **Create a Windows MSIX package** is unchecked: | ||
|
||
:::image type="content" source="../media/setup/packaged-app-unchecked.png" alt-text="Screenshot of Create a Windows MSIX package unchecked in Visual Studio."::: | ||
|
||
Visual Studio will modify your app's project file (*.csproj) to set the `$(WindowsPackageType)` build property to `None`: | ||
|
||
```xml | ||
<PropertyGroup> | ||
<WindowsPackageType>None</WindowsPackageType> | ||
</PropertyGroup> | ||
``` | ||
|
||
In addition, your app's *Properties/launchSettings.json* file will have the `commandName` value changed from `MsixPackage` to `Project`: | ||
|
||
```json | ||
{ | ||
"profiles": { | ||
"Windows Machine": { | ||
"commandName": "Project", | ||
"nativeDebugging": false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> If your app defines multiple launch setting profiles you'll have to manually update the `commandName` value from `MsixPackage` to `Project` for each profile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
ms.topic: include | ||
ms.date: 11/07/2024 | ||
--- | ||
|
||
## Convert an unpackaged .NET MAUI Windows app to packaged | ||
|
||
If your app needs to use APIs that are only available with Windows packaged apps and you plan on distributing your app through the Microsoft Store, you'll need to convert your unpackaged app to a packaged app. This can be achieved in Visual Studio: | ||
|
||
1. In **Solution Explorer**, right-click on your .NET MAUI app project and select **Properties**. Then, navigate to the **Application > Windows Targets** tab and ensure that **Create a Windows MSIX package** is checked: | ||
|
||
:::image type="content" source="../media/setup/packaged-app-checked.png" alt-text="Screenshot of Create a Windows MSIX package checked in Visual Studio."::: | ||
|
||
Visual Studio will modify your app's project file (*.csproj*) to remove the `<WindowsPackageType>None</WindowsPackageType>` line. In addition, your app's *Properties/launchSettings.json* file will have the `commandName` value changed from `Project` to `MsixPackage`: | ||
|
||
```json | ||
{ | ||
"profiles": { | ||
"Windows Machine": { | ||
"commandName": "MsixPackage", | ||
"nativeDebugging": false | ||
} | ||
} | ||
} | ||
``` | ||
|
||
> [!IMPORTANT] | ||
> If your app defines multiple launch setting profiles you'll have to manually update the `commandName` value from `Project` to `MsixPackage` for each profile. | ||
When deploying a packaged .NET MAUI Windows app, you'll need to enable Developer Mode in Windows. For more information, see [Configure Windows for packaged app deployment](#configure-windows-for-packaged-app-deployment). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
ms.topic: include | ||
ms.date: 11/07/2024 | ||
--- | ||
|
||
## Target Windows | ||
|
||
::: moniker range="=net-maui-8.0" | ||
|
||
In Visual Studio, set the **Debug Target** to **Framework (...)** > **net8.0-windows**. There is a version number in the item entry, which may or may not match the following screenshot: | ||
|
||
:::image type="content" source="../media/setup/vs-target-windows-net8.png" alt-text="Visual Studio debug target set to Windows for .NET MAUI 8 app."::: | ||
|
||
::: moniker-end | ||
|
||
::: moniker range="=net-maui-9.0" | ||
|
||
In Visual Studio, set the **Debug Target** to **Framework (...)** > **net9.0-windows**. There is a version number in the item entry, which may or may not match the following screenshot: | ||
|
||
:::image type="content" source="../media/setup/vs-target-windows-net9.png" alt-text="Visual Studio debug target set to Windows for .NET MAUI 9 app."::: | ||
|
||
::: moniker-end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters