dotnet / docs-maui

This repository contains documentation for .NET Multi-platform App UI (MAUI).
https://docs.microsoft.com/dotnet/maui
Creative Commons Attribution 4.0 International
222 stars 194 forks source link

.NET MAUI 9: Update doc to describe how .NET 9 uses unpackaged F5 to Windows #2415

Open BethMassi opened 1 month ago

BethMassi commented 1 month ago

Type of issue

Other (describe below)

Description

For .NET 9, we're changing the default F5 deployment for Windows to Unpackaged so that we can address new users who are unable to turn on Developer Mode on their Windows machines. This will be a change for new projects that will add the WindowsPackageType attribute in the .csproj and set the launchSetting.json commandName to "Project". We need to document how to switch it back to Packaged if users need to access Windows Deployment APIs that only work with Packaged apps.

PR is here: https://github.com/dotnet/maui/pull/23787

Page URL

https://learn.microsoft.com/en-us/dotnet/maui/windows/setup?view=net-maui-9.0

Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/windows/setup.md

Document Version Independent Id

e139fd32-4027-b014-115f-18f53ab6a46c

Article author

@davidbritch

Metadata

BethMassi commented 1 month ago

This is landing for .NET 9 RC1.

BethMassi commented 1 month ago

@davidbritch I'm not sure how you want to structure this article for .NET 9. There shouldn't be any configuration needed except to select the Windows Machine / net9.0-windows10.0.19041.0 debug target. Here's a blurb introducing Unpackaged F5 experience and how to switch it to Packaged.

When debugging and deploying a new .NET MAUI project to Windows, the default behavior is to deploy the app as Unpackaged. This is controlled by the following settings.

In your project's .csproj file the property <WindowsPackageType>None</WindowsPackageType> sets the app as Unpackaged.

In your Properties/launchSettings.json file the commandName value for the Windows profile is set to Project.

{
  "profiles": {
    "Windows Machine": {
      "commandName": "Project",
      "nativeDebugging": false
    }
  }
}

If your app needs to use APIs that are only available with Windows Packaged apps and you plan on distributing your Windows app through the Microsoft Store, you can change these settings to debug and deploy as Packaged.

Remove the <WindowsPackageType>None</WindowsPackageType> property from your project's .csproj file.

In your Properties/launchSettings.json file set the commandName value for the Windows profile to MsixPackage.

{
  "profiles": {
    "Windows Machine": {
      "commandName": "MsixPackage",
      "nativeDebugging": false
    }
  }
}

When you change these settings, you will need to enable Developer Mode on your Windows Machine. For more information about Packaged vs. Unpackaged Windows apps see Windows apps: packaging, deployment, and process.

davidbritch commented 3 weeks ago

https://github.com/dotnet/maui/pull/23787