Fix unpackaged WinUI debugging in VS Code - #19877
Conversation
Launch unpackaged WinUI project resources through their generated apphost executable so vsdbg does not host XAML startup in dotnet.exe. Add focused unit coverage and a pinned Windows extension E2E shard. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc450e2e-3277-4c6f-adb2-47f8344c0c59
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19877Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19877" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The apphost selection can skip a required rebuild when the DLL is missing, and the new E2E timeout is undersized.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes unpackaged WinUI debugging by launching the generated apphost executable instead of the managed DLL.
Changes:
- Evaluates additional MSBuild launch properties to detect unpackaged WinUI projects.
- Adds unit and Windows E2E regression coverage.
- Adds a pinned, blocking WinUI E2E workflow shard.
File summaries
| File | Description |
|---|---|
extension/src/debugger/languages/dotnet.ts |
Selects the WinUI apphost executable. |
extension/src/test/dotnetDebugger.test.ts |
Tests MSBuild property parsing and launch selection. |
extension/src/test-e2e/winUiDebug.e2e.test.ts |
Verifies WinUI reaches OnLaunched. |
extension/scripts/run-e2e.js |
Generates and configures the WinUI fixture. |
.github/workflows/extension-e2e-tests.yml |
Adds the Windows WinUI shard and debugger prerequisites. |
extension/src/test/e2eLaunchProfile.test.ts |
Validates the new workflow wiring and pins. |
extension/CONTRIBUTING.md |
Documents running and understanding the shard. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Balanced
Check both the generated apphost executable and its managed target before skipping the project build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc450e2e-3277-4c6f-adb2-47f8344c0c59
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The WinUI E2E suite timeout remains shorter than its aggregate waits, creating a concrete CI flake risk.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Raise the scenario timeout above its composed waits so phase-specific diagnostics fire first, and pin the budget in the E2E infrastructure test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc450e2e-3277-4c6f-adb2-47f8344c0c59
This comment has been minimized.
This comment has been minimized.
Use a shared diagnostic for debugger-backed shards now that WinUI and Azure Functions both install the .NET debugger dependencies. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: dc450e2e-3277-4c6f-adb2-47f8344c0c59
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is scoped, preserves existing launch behavior, and includes focused unit and E2E regression coverage.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
The targeted implementation preserves existing launch behavior and includes focused unit and blocking Windows E2E coverage.
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Tests selector1 / 99 PR test projects · 2 PR jobs · 0 advisory-only targets, from 6 changed files. Selected PR test projects (1 / 99)
Selected PR jobs (2)
Advisory workflow impact (0)none How these were chosen — grouped by what changed📄 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Pull request created: #1616
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1616 targeting Triggered signal: Note This draft PR needs human review before merging. |
|
The CI build contains both transient and non-transient failures. Failed jobs:
The CI will not be automatically rerun. Please review the failures above. |
Description
Unpackaged WinUI 3 project resources crash in
Microsoft.UI.Xaml.Application.Start()when debugged through the Aspire VS Code extension because the extension launches the managedTargetPathDLL. That makesvsdbghost WinUI startup indotnet.exe, which consistently faults with0xC000027B.This change detects unpackaged WinUI projects from evaluated MSBuild properties and launches their generated apphost executable (
RunCommand) instead. The AppHost and resource keep their existing Aspire parent/child debug topology and lifecycle behavior.User-facing usage
No project configuration changes are required. Existing unpackaged WinUI resources can keep a normal
Projectlaunch profile:The extension now resolves that resource to the generated
.exewhile retaining debugger attach, launch-profile arguments, environment variables, and cleanup behavior.The change also adds a blocking Windows extension E2E shard. It generates a minimal unpackaged WinUI app using the package version from the reported repro, installs pinned C# debugger prerequisites, and requires an
Application.OnLaunchedreadiness marker. Reaching that marker proves startup passed the originalApplication.Startfailure point.Validation:
0xC000027B,Microsoft.UI.Xaml.dll, faultingdotnet.exe..exeis launched.extension/build.ps1corepack yarn run compile-testscorepack yarn run compile-e2ecorepack yarn run lintcorepack yarn run compileVS Code extension E2E (Windows, winui-debug)Fixes #19091
Checklist
<remarks />and<code />elements on your triple slash comments?