microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.79k stars 319 forks source link

Single-project MSIX solutions have F5 debugging rough edges #3064

Open Scottj1s opened 1 year ago

Scottj1s commented 1 year ago

Describe the bug

After creating a Windows App SDK Single-project MSIX solution, F5 debugging requires several conditions:

  1. The application must have the Deploy option checked in the Configuration Manager, which in turn requires that
  2. The Single-project MSIX Packaging Tools extension must be installed, and finally
  3. The launchSettings.json file must contain an MsixPackage profile.

If any of these conditions are not met, debugging fails either prior to launch or at runtime, with cryptic diagnostics. Ideally, the Windows App SDK build and or debug support could detect missing prerequisites and inform the user. For example, project templates might be able to include a RequiredBundles element to ensure that the Single-project MSIX Packaging Tools extension is present if and only if debugging (not simply building). LaunchSettings.json files are easily .gitignored when creating a new github repo. It's possible for the build to detect this (or a missing MsixPackage profile within) and warn the user.

If you’ve checked the workload options for Windows App SDK C++ or C# project templates, then you’ll pick up the Single-project MSIX Packaging Tools extension. So this appears to be more of a “create a solution, add to source control, clone elsewhere” scenario.

Steps to reproduce the bug

See description

Expected behavior

No response

Screenshots

No response

NuGet package version

No response

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

No response

asklar commented 1 year ago

Additional scenario: projects with more than one PC (or more than one contributor) By default, launchSettings.json is gitignore'd, so even if you have everything set up as per golden path, other people working on the project won't be able to launch it, as they will be missing the json file. The error is cryptic for sure.