Repository navigation
Add Microsoft.Windows.SDK.BuildTools.WinApp dependency for Windows apps - #36889
Conversation
Add the Microsoft.Windows.SDK.BuildTools.WinApp NuGet package (v0.3.1) as a dependency for all MAUI Windows apps. This package provides MSBuild targets that enable 'dotnet run' for MSIX-packaged Windows applications by automatically registering loose-layout packages and launching the app. Changes: - eng/Versions.props: Add version variable - eng/NuGetVersions.targets: Add central version pinning - src/Core/src/Core.csproj: Add PackageReference in Windows ItemGroup - .github/dependabot.yml: Add to WindowsAppSDK group Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36889Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36889" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Skill Validation Results
✅ Skill Validation Results —
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1f8d588b-4add-43c5-9c55-e943bef6ff3f
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds Microsoft.Windows.SDK.BuildTools.WinApp as a transitive dependency for MAUI Windows targets so MSIX-packaged Windows apps can be launched via dotnet run (loose-layout registration + winapp run), and aligns the Controls sample’s Windows launch profile with MSIX packaging.
Changes:
- Adds
Microsoft.Windows.SDK.BuildTools.WinAppPackageReferencefor-windowsTFMs inCore.csproj. - Introduces central version pinning for the new package (
0.5.0) viaeng/Versions.props+eng/NuGetVersions.targets. - Updates dependabot grouping and switches the sample launch profile to
commandName: "MsixPackage".
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Core/src/Core.csproj |
Adds the WinApp build tools dependency for Windows TFMs so it can flow transitively to MAUI Windows apps. |
eng/Versions.props |
Defines MicrosoftWindowsSDKBuildToolsWinAppPackageVersion (0.5.0). |
eng/NuGetVersions.targets |
Centrally pins Microsoft.Windows.SDK.BuildTools.WinApp to the new version property. |
.github/dependabot.yml |
Includes the new package in the existing WindowsAppSDK dependabot group. |
src/Controls/samples/Controls.Sample/Properties/launchSettings.json |
Updates Windows launch profile to MsixPackage to match MSIX packaging mode. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
…36891) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description Bumps the Windows-related NuGet pins in `eng/Versions.props` to the latest stable releases. These four properties are consumed centrally via `eng/NuGetVersions.targets` (`<PackageReference Update=... />`), so this single file is the only change needed. | Package | Property | Old | New | | --- | --- | --- | --- | | `Microsoft.WindowsAppSDK` | `MicrosoftWindowsAppSDKPackageVersion` | `1.8.251106002` | **`2.3.1`** | | `Microsoft.Windows.SDK.BuildTools` | `MicrosoftWindowsSDKBuildToolsPackageVersion` | `10.0.26100.4654` | **`10.0.28000.2526`** | | `Microsoft.Web.WebView2` | `MicrosoftWindowsWebView2PackageVersion` | `1.0.3179.45` | **`1.0.4078.44`** | | `Microsoft.Graphics.Win2D` | `MicrosoftGraphicsWin2DPackageVersion` | `1.3.2` | **`1.4.0`** | All four were verified as the latest *listed stable* versions against the NuGet flat-container index. ### Windows App SDK 1.8 → 2.3.1 (major version jump) This is the notable part of the change, so it got extra scrutiny. **No source changes were required.** Findings: - **No API/namespace churn.** The `Microsoft.UI.Xaml` surface that MAUI consumes is unchanged; Core, Controls, Essentials and Graphics.Win2D all compile against 2.3.1 with zero new errors. - **No minimum-TFM bump.** `Directory.Build.targets` keeps `TargetPlatformMinVersion`/`SupportedOSPlatformVersion` at `10.0.17763.0`. WinAppSDK 2.x validates against `WindowsSdkPackageVersion` (repo value `10.0.19041.44`) and that check passes unchanged. - **Bootstrapper / packaging behavior is unchanged for us.** Unpackaged apps still resolve `WindowsAppSDKSelfContained=true` and packaged apps still resolve `WindowsPackageType=MSIX`, exactly as before the bump. An unpackaged self-contained publish was verified to emit the full bootstrap set (`Microsoft.WindowsAppRuntime.Bootstrap.dll`, `Microsoft.WindowsAppRuntime.Bootstrap.Net.dll`, `Microsoft.WindowsAppRuntime.dll`) plus all expected `.pri` resources. - **Transitive graph resolves cleanly** — `Microsoft.WindowsAppSDK.WinUI 2.3.0`, `Foundation 2.3.5`, `Base 2.0.4`, `Runtime 2.3.1`, etc. ### NuGet feeds No `NuGet.config` change is required. All four versions were confirmed present in the `dotnet-public` dnceng feed already configured by the repo, and restore succeeds from the existing sources — `nuget.org` was **not** added. ### Helix device tests `eng/devices/run-windows-devicetests.cmd` derives the Windows App Runtime installer URL by parsing major.minor out of `MicrosoftWindowsAppSDKPackageVersion`, so it follows this bump automatically with no edit. Verified that the resulting channel URL `https://aka.ms/windowsappsdk/2.3/latest/windowsappruntimeinstall-x64.exe` resolves successfully. ### Validation All builds below were run against a **fully pristine tree** — `artifacts/`, `.buildtasks/` and every `obj`/`bin` removed, with MSBuild node reuse shut down first so no stale task assemblies were reused. | Build | Result | | --- | --- | | `Microsoft.Maui.BuildTasks.slnf` (full, incl. both Windows TFMs) | ✅ 0 errors | | `Maui.Controls.Sample` — `net11.0-windows10.0.19041.0` | ✅ 0 errors | | `Maui.Controls.Sample` — `net11.0-windows10.0.20348.0` | ✅ 0 errors | | `Essentials.Sample` (MSIX packaged) — `net11.0-windows10.0.19041.0` | ✅ 0 errors | | `Core.DeviceTests` (MSIX packaged) — `net11.0-windows10.0.19041.0` | ✅ 0 errors | | `Core.DeviceTests` (unpackaged, self-contained publish, `win-x64`) | ✅ 0 errors | Build-only validation; no apps were launched. Warning counts are unchanged from the pre-bump baseline. ### Notes - `MicrosoftWindowsSDKBuildToolsWinAppPackageVersion` is intentionally untouched — that property does not exist on `net11.0` and is owned by #36889. - `src/Templates/src/cgmanifest.json` contains the old version strings but is auto-generated (regenerated in CI via `eng/scripts/update-cgmanifest.ps1`) and is deliberately **not** committed here. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 546491d2-db16-496e-97fa-41cfe758db9b
AI Review Summary
🗂️ Review Sessions — click to expand🚦 Gate — Test Before & After FixGate Result:
|
| Category | Tests | Snapshot diffs |
|---|---|---|
Button |
69/70 ✓ | — |
Label |
91/94 ✓ | — |
Layout |
184/188 ✓ | — |
📎 Download drop-deep-uitests artifact (TRX + snapshot diffs) |
📋 Pre-Flight — Context & Validation
Issue: N/A - No linked issue found
PR: #36889 - Add Microsoft.Windows.SDK.BuildTools.WinApp dependency for Windows apps
Platforms Affected: Windows build/run tooling; Controls.Sample Windows launch profile
Files Changed: 6 implementation/configuration, 0 test
Key Findings
- PR adds
Microsoft.Windows.SDK.BuildTools.WinApptosrc/Core/src/Core.csprojunder the Windows TFM ItemGroup, with central version/dependabot updates. - PR changes
src/Controls/samples/Controls.Sample/Properties/launchSettings.jsontocommandName: "MsixPackage"while the sample project still actively sets<WindowsPackageType>None</WindowsPackageType>. - Gate was already skipped because no tests were detected in this PR; no gate rerun was performed.
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: low
Errors: 1 | Warnings: 0 | Suggestions: 0
Key code review findings:
- ✗
src/Controls/samples/Controls.Sample/Properties/launchSettings.json:4conflicts withsrc/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj:28;MsixPackagelaunch is paired with an explicitly unpackaged sample (WindowsPackageType=None).
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #36889 | Add WinApp as a transitive Windows dependency from Core and switch Controls.Sample launch profile to MsixPackage |
.github/dependabot.yml, eng/NuGetVersions.targets, eng/Versions.props, src/Core/src/Core.csproj, src/Controls/samples/Controls.Sample/Main.razor, src/Controls/samples/Controls.Sample/Properties/launchSettings.json |
Original PR has sample packaging mismatch |
🔬 Code Review — Deep Analysis
Code Review — PR #36889
Independent Assessment
What this changes: Adds Microsoft.Windows.SDK.BuildTools.WinApp as a Windows-only dependency of Microsoft.Maui.Core, centrally pins its version, adds it to Dependabot grouping, and changes the Controls sample Windows launch profile from Project to MsixPackage.
Inferred motivation: Enable packaged Windows MAUI apps to run through the newer WinApp CLI/build tooling path.
Reconciliation with PR Narrative
Author claims: The new package enables dotnet run for MSIX-packaged Windows apps and the sample launch profile is changed to match MSIX packaging mode.
Agreement/disagreement: The dependency/versioning changes match the stated goal. The launch profile claim does not match the project file: the Controls sample still explicitly sets <WindowsPackageType>None</WindowsPackageType>.
Prior Review Reconciliation
No prior ❌ Error findings found. Existing Copilot reviews generated no comments; inline review comments were empty.
Blast Radius Assessment
- Runs for all instances: Yes, the new package flows transitively through
Microsoft.Maui.Corefor Windows TFMs. - Startup impact: No runtime startup code changed.
- Static/shared state: No.
CI Status
- Required-check result: undetermined/pending.
gh pr checks --requiredwas unavailable due missing GitHub auth. REST check runs for head SHA showedmaui-prqueued/in-progress. - Classification: undetermined.
- Action taken: capped confidence; per code-review rules, no
LGTMwhile CI is pending/undetermined.
Findings
❌ Error — Sample launch profile now conflicts with unpackaged project configuration
src/Controls/samples/Controls.Sample/Properties/launchSettings.json:4 changes the Windows profile to:
"commandName": "MsixPackage"But the same sample project still explicitly opts into unpackaged mode:
<WindowsPackageType>None</WindowsPackageType>at src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj:28. The project comment at lines 34-39 also documents that WindowsPackageType=None should be paired with commandName: "Project", not MsixPackage.
As-is, Visual Studio/F5 for this sample is likely to attempt MSIX launch behavior for a project configured as unpackaged. Either revert the launch profile to Project, or remove/change the active WindowsPackageType=None if the sample is intended to become packaged.
Failure-Mode Probing
- Unpackaged sample launched from VS: profile requests
MsixPackage, but no MSIX package is configured becauseWindowsPackageType=None; launch/deploy can fail. - Apps not using packaged launch: transitive package dependency is build-time only and Windows-scoped; no runtime code path or handler lifecycle risk found.
- Non-Windows TFMs:
Core.csprojpackage reference is under$(TargetFramework.Contains('-windows')), so no Android/iOS/MacCatalyst impact expected.
Verdict: NEEDS_CHANGES
Confidence: low, because this is Windows build/tooling infrastructure and CI was pending/undetermined.
Summary: The package addition itself looks structurally consistent, but the sample launch profile change contradicts the project’s explicit unpackaged configuration and should be corrected before merge.
🛠️ Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix | Keep WinApp dependency in Core, but revert Controls.Sample launch profile to Project so it matches WindowsPackageType=None |
✅ Static PASS; |
1 file relative to PR | Best candidate under available evidence; narrowly fixes the review finding without changing sample packaging defaults |
| 2 | try-fix | Keep MsixPackage launch profile and convert Controls.Sample to packaged-by-default by removing active WindowsPackageType=None |
✅ Static PASS; |
1 file relative to PR | Coherent but broader behavior change for contributors running the sample |
| 3 | try-fix | Move WinApp from Core to a buildTransitive MSIX-only implicit PackageReference | ❌ FAIL | 2 files relative to PR | Fails restore-correctness validation because shipped target lacks consumer-visible package version |
| PR | PR #36889 | Add WinApp dependency through Core and switch Controls.Sample launch profile to MsixPackage |
6 files | Original PR has launch profile/package type mismatch |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| gpt-5.5 / maui-expert-reviewer | 1 | Yes | Revert only launchSettings.json to preserve unpackaged sample behavior while keeping WinApp package flow |
| claude-opus-4.7 / maui-expert-reviewer | 1 | Yes | Make Controls.Sample packaged-by-default to align with MsixPackage, but noted this is riskier than candidate 1 |
| gpt-5.3-codex / maui-expert-reviewer | 1 | Yes | Scope WinApp as an implicit MSIX-only target dependency; validation found package-version/restore risk |
Exhausted: Yes
Selected Fix: Candidate #1 — it directly fixes the concrete review finding with the smallest behavior change. Candidate #2 is coherent but changes Windows sample defaults, and candidate #3 fails restore-correctness validation. End-to-end Windows build/run validation was blocked by an unrelated existing sample restore asset issue, so selection is based on targeted static regression checks plus expert risk comparison.
📝 Recommended PR Title & Description
Assessment: ✏️ Recommend updating — the winning fix keeps the existing unpackaged Controls.Sample launch profile, while the current description says it changes that profile to MsixPackage and omits the related Windows package version bumps plus the Main.razor cleanup.
Recommended title
[Windows] Build: Add WinApp build tools dependency for MAUI apps
Recommended description
## Description
Adds the [`Microsoft.Windows.SDK.BuildTools.WinApp`](https://www.nuget.org/packages/Microsoft.Windows.SDK.BuildTools.WinApp) NuGet package (v0.5.0) as a Windows dependency for MAUI apps through `Microsoft.Maui.Core`. This package provides MSBuild targets that enable `dotnet run` for MSIX-packaged Windows applications by automatically registering loose-layout packages and launching the app via `winapp run`.
## Changes
- **`eng/Versions.props`** — Add `MicrosoftWindowsSDKBuildToolsWinAppPackageVersion` and update related Windows dependency versions:
- `Microsoft.WindowsAppSDK` to `2.3.1`
- `Microsoft.Windows.SDK.BuildTools` to `10.0.28000.2526`
- `Microsoft.Graphics.Win2D` to `1.4.0`
- `Microsoft.Web.WebView2` to `1.0.4078.44`
- **`eng/NuGetVersions.targets`** — Add central version pinning for `Microsoft.Windows.SDK.BuildTools.WinApp`.
- **`src/Core/src/Core.csproj`** — Add the `Microsoft.Windows.SDK.BuildTools.WinApp` `PackageReference` in the Windows ItemGroup so it flows transitively to MAUI Windows apps.
- **`.github/dependabot.yml`** — Add `Microsoft.Windows.SDK.BuildTools.WinApp` to the `WindowsAppSDK` Dependabot group for automated version bumps.
- **`src/Controls/samples/Controls.Sample/Main.razor`** — Remove the obsolete `PreferExactMatches` router parameter.
## Windows sample launch profile
`src/Controls/samples/Controls.Sample/Properties/launchSettings.json` remains on `commandName: "Project"` because `Maui.Controls.Sample.csproj` explicitly sets `<WindowsPackageType>None</WindowsPackageType>`. Keeping those settings aligned preserves the sample's existing unpackaged Windows launch behavior while the new WinApp dependency supports packaged MAUI Windows apps.
🏁 Report — Final Recommendation
Comparative Report — PR #36889
Candidate ranking
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | pr-plus-reviewer |
Static PASS; build smoke evidence inherited from equivalent try-fix-1 was blocked by unrelated assets issue |
Best candidate. It keeps the PR's Windows WinApp dependency flow and applies the expert reviewer's only actionable fix by restoring the sample launch profile to Project, matching <WindowsPackageType>None</WindowsPackageType>. |
| 2 | try-fix-1 |
Static PASS; Windows sample restore completed; build smoke BLOCKED by unrelated MauiRazorClassLibrarySample project.assets.json target issue |
Functionally equivalent to pr-plus-reviewer for the reviewer finding and validated with targeted static checks. Ranked below pr-plus-reviewer only because the requested reviewer-applied PR candidate is the direct path for this phase. |
| 3 | try-fix-2 |
Static PASS; build smoke BLOCKED by the same unrelated issue | Coherent because it makes the sample packaged-by-default to match MsixPackage, but it is broader than necessary and changes contributor/sample behavior. |
| 4 | pr |
Gate skipped; expert review found a major build/MSBuild issue | The raw PR keeps MsixPackage while the sample project remains explicitly unpackaged, creating a launch/debug mismatch. |
| 5 | try-fix-3 |
FAIL | Must rank below passing candidates. Moving WinApp into buildTransitive implicit target injection failed restore-correctness validation because the shipped target lacked a consumer-visible package version. |
Winning candidate
Winner: pr-plus-reviewer
pr-plus-reviewer wins because it addresses the expert reviewer's actionable finding with the smallest safe change: retain the new Microsoft.Windows.SDK.BuildTools.WinApp dependency and related version/dependabot updates, but do not change Controls.Sample to an MSIX launch profile while it remains unpackaged. This is lower risk than making the sample packaged-by-default and avoids the restore/versioning failure in try-fix-3.
Notes
- The raw PR description should be updated if
pr-plus-revieweris used, because it currently claimslaunchSettings.jsonis changed toMsixPackage. - No regression test was added in the PR. The gate was skipped because no tests were detected; targeted static validation from STEP 5a is the available evidence for the launch-profile regression.
🧭 Next Steps — review latest findings
No alternative fix was selected for this run. Review the session findings and CI results before merging.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Adds the
Microsoft.Windows.SDK.BuildTools.WinAppNuGet package (v0.5.0) as a dependency for all MAUI Windows apps. This package provides MSBuild targets that enabledotnet runfor MSIX-packaged Windows applications by automatically registering loose-layout packages and launching the app viawinapp run.Changes
eng/Versions.props— AddMicrosoftWindowsSDKBuildToolsWinAppPackageVersionversion variableeng/NuGetVersions.targets— Add central version pinning for the packagesrc/Core/src/Core.csproj— AddPackageReferencein the Windows ItemGroup (flows transitively to all MAUI Windows apps).github/dependabot.yml— Add toWindowsAppSDKdependabot group for automated version bumpssrc/Controls/samples/Controls.Sample/Properties/launchSettings.json— UpdatecommandNametoMsixPackageto match MSIX packaging mode