Repository navigation
Open
Description
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 fordotnet run) and only activate whenWindowsPackageType != 'None'andEnableWinAppRunSupport=true. - Build a loose-layout AppX from the build output.
- Invoke the bundled
winapp.exeto 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:
- Internal
SamplesApp.Windows— opt in directly via aPackageReference, so contributors can usedotnet runagainst the SamplesApp. - 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.WinAppreference inUno.Implicit.Packages.ProjectSystem.WinAppSdk.targets, gated on$(_IsExecutable) == 'true'so libraries are not affected. - Add a new
WinAppSdkBuildToolsWinAppgroup tosrc/Uno.Sdk/packages.json(default0.3.1) wired throughPackageManifest,ImplicitPackagesResolver, andUno.Implicit.Packages.targets. - Expose
WinAppSdkBuildToolsWinAppVersion(version override) andUnoDisableWinAppRunSupport(drop the implicit reference) inSdk.props.buildschema.jsonfor IntelliSense. Users can additionally setEnableWinAppRunSupport=falseto keep the reference but disable thedotnet runinterception. - Add the same
PackageReferencetosrc/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. |
Metadata
Metadata
Assignees
Labels
No labels
Activity
feat: Enable `dotnet run` for packaged WinUI apps
feat: Enable `dotnet run` for packaged WinUI apps
github-actions commentedon Sep 26, 2026
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.
github-actions commentedon Oct 6, 2026
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.
Jen-Uno commentedon Oct 28, 2026
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.