Skip to content

Enable dotnet run for packaged WinUI apps via Microsoft.Windows.SDK.BuildTools.WinApp #23345

Open

Description

@MartinZikmund

Background

Microsoft has shipped a new dotnet new template family for WinUI together with Microsoft.Windows.SDK.BuildTools.WinApp, which enables dotnet run to launch a packaged WinAppSDK app with package identity directly from the command line, without Visual Studio.

See the announcement: https://devblogs.microsoft.com/ifdef-windows/introducing-dotnet-new-templates-for-winui/

Under the hood, the package adds MSBuild targets that:

  • Hook into ComputeRunArguments (the official extensibility point for dotnet run) and only activate when WindowsPackageType != 'None' and EnableWinAppRunSupport=true.
  • Build a loose-layout AppX from the build output.
  • Invoke the bundled winapp.exe to register a debug identity and launch the app via AUMID (or execution alias for console scenarios).

Build, publish, and the existing MSIX packaging flow are unaffected.

Goal

Make both consumption surfaces benefit from this:

  1. Internal SamplesApp.Windows — opt in directly via a PackageReference, so contributors can use dotnet run against the SamplesApp.
  2. Uno.Sdk-based apps targeting WinAppSDK — pull in the package implicitly for executable WinAppSDK projects, version-managed centrally in packages.json, with the usual override + opt-out knobs.

Proposed changes

  • Add an implicit Microsoft.Windows.SDK.BuildTools.WinApp reference in Uno.Implicit.Packages.ProjectSystem.WinAppSdk.targets, gated on $(_IsExecutable) == 'true' so libraries are not affected.
  • Add a new WinAppSdkBuildToolsWinApp group to src/Uno.Sdk/packages.json (default 0.3.1) wired through PackageManifest, ImplicitPackagesResolver, and Uno.Implicit.Packages.targets.
  • Expose WinAppSdkBuildToolsWinAppVersion (version override) and UnoDisableWinAppRunSupport (drop the implicit reference) in Sdk.props.buildschema.json for IntelliSense. Users can additionally set EnableWinAppRunSupport=false to keep the reference but disable the dotnet run interception.
  • Add the same PackageReference to src/SamplesApp/SamplesApp.Windows/SamplesApp.Windows.csproj.

Behavior after the change

Project shape Behavior
WinAppSDK library No change (excluded via _IsExecutable).
WinAppSDK unpackaged single-project (WindowsPackageType=None) Package referenced, targets are no-ops, standard dotnet run is used.
WinAppSDK packaged single-project (WindowsPackageType=MSIX) dotnet run performs loose-layout register + launch with package identity.
SamplesApp.Windows dotnet run launches the packaged SamplesApp with identity.

Activity

  1. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  2. added
    stale
    on Sep 26, 2026
  3. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    This issue was closed because it had no activity for 10 days after being marked as stale. If you believe this is still relevant, feel free to reopen it or open a new issue with updated context.

  4. Jen-Uno commented on Oct 28, 2026

    @Jen-Uno
    Contributor

    This issue was closed as not planned, so there is nothing for QA to verify. Moving it from Ready for QA Review to Done on the Uno Team Backlog.

  5. removed
    stale
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions