Repository navigation
winapp run: fix packaged C++ Debug apps failing on the debug CRT path - #1030
Conversation
A C++ Debug build lists the debug CRT as 'C:\Program Files %28x86%29\...\ucrtbased.dll'. winapp checked that escaped path literally, so every such packaged app failed with 'The build did not produce 1 file(s) the recipe lists'. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…choices - MSB8036: suggest 'winget install Microsoft.WindowsSDK.<the version the project needs>' instead of always 10.0.26100, which did not fix the build. - When several C# apps make a solution or folder ambiguous, also list the C++ app projects; they lose auto-selection to C# apps but are valid --project choices. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Build Metrics ReportValidation passed. All required build and validation jobs succeeded. Binary Sizes
.NET Test Results (TRX reports)Other suites are reflected in the overall validation status above. ✅ 8250 passed, 37 skipped out of 8287 tests in 1112.9s (+12 tests, -310.0s vs. baseline) Test Coverage✅ 86.6% line coverage, 81.2% branch coverage · ✅ no change vs. baseline CLI Startup Time62ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 1030Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 1030Run Updated 2026-10-08 21:01:42 UTC · commit |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The fixes are focused, adequately tested, and no unresolved defects were found.
0 open findings
What changed in this PR
Fixes three winapp run issues affecting packaged C++ applications.
Changes:
- Unescapes MSBuild recipe source paths before staging.
- Suggests the Windows SDK version reported by MSBuild.
- Includes runnable C++ projects in ambiguity choices.
| File | Description |
|---|---|
ProjectRunService.Input.cs |
Lists runnable C++ project choices. |
ProjectRunService.Cpp.cs |
Extracts the missing SDK version. |
MsixService.Identity.cs |
Unescapes recipe source paths. |
ProjectRunServiceCppTests.cs |
Covers selection and SDK diagnostics. |
MsixServiceIdentityTests.cs |
Covers escaped recipe paths. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
… building, hint vcpkg integration - An exe whose manifest requires administrator rights now says so instead of surfacing the raw 'requested operation requires elevation' error. - A project-mode run targeting an architecture this machine can't run fails before the build; --no-launch and remote execution targets still build. - A C++ build that can't find headers, has a vcpkg.json, and has no vcpkg MSBuild integration (_ZVcpkgRoot empty) suggests 'vcpkg integrate install'. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
--runtime outranks --arch, which outranks -p Platform, so suggesting a lower-ranked option looped back to the same error. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Real-world C++ WinUI 3 test resultsI ran
Not done here: friendlier wording for |
…estion With --arch or -r plus a matching -p Platform, suggesting only the winning option produced a pair the C++ build rejects as conflicting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Conflicts: - RunCommand.ProjectMode.cs: keep main's requireAdministrator message (#1030) and this branch's RunFailure.Describe for the other launch errors. - FakeAppLauncherService.cs: keep main's LaunchExecutableThrows and this branch's environment parameter. - winapp-ui-automation SKILL.md: main's 300-char description plus the winui-devtools pointer. Also trims the winui-devtools description to the 300-char budget from #985. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Description
I tested
winapp run(main at 1662e76) on real open-source and Microsoft-sample C++ WinUI 3 apps. This PR fixes the problems that were on our side:*.build.appxrecipeescaped, so the debug CRT appears asC:\Program Files %28x86%29\...\ucrtbased.dll. winapp looked for that literal path and refused to stage the layout. This hit Microsoft's PhotoEditor and Windowing C++ samples on Windows App SDK 1.5, 1.8 and 2.x. winapp now unescapes recipe source paths.wingetsuggestion. ForMSB8036we always suggestedMicrosoft.WindowsSDK.10.0.26100, even when the project needs 10.0.22621. The hint now names the version from the MSBuild error.--projectchoices left out C++ app projects, even though--project <cpp app>works. They are now listed.requireAdministratorfailed with Windows' raw "The requested operation requires elevation". winapp now says what's going on.-p Platform=ARM64(or--arch arm64) on an x64 PC built for minutes, then failed with a misleading Windows App Runtime error. It now fails right away. The suggested fix changes whichever option chose the architecture (-r,--archor-p Platform).--no-launchand remote execution targets still build.vcpkg.jsonand no vcpkg MSBuild integration, now suggestsvcpkg integrate install. "No integration" means MSBuild's evaluation of_ZVcpkgRootis empty; onlyvcpkg.targetsdefines that property. A project that imports vcpkg itself gets no hint.Usage Example
All output below is observed from the projects named.
PhotoEditor (
microsoft/WindowsAppSDK-Samples,Samples\PhotoEditor\cpp-winui):winapp run . --detach --jsonBefore:
After:
WinUIEdit (
BreeceW/WinUIEdit):winapp run WinUIEditor.sln --project CppDemoWinUI3 --detach --jsonBefore:
... winget install Microsoft.WindowsSDK.10.0.26100 ...After:
WinUIEdit:
winapp run .Before:
'WinUIEditor.sln' contains multiple runnable app projects (CsDemoWinUI3.csproj, WinFormsIslandsDemo.csproj, WpfIslandsDemo.csproj). ...After:
'WinUIEditor.sln' contains multiple runnable app projects (CppDemoUwp.vcxproj, CppDemoWinUI3.vcxproj, CppIslandsDemo.vcxproj, CsDemoWinUI3.csproj, WinFormsIslandsDemo.csproj, WpfIslandsDemo.csproj). Specify which project to run with --project <name>.StarlightGUI (
OpenStarlight/StarlightGUI, Debug|x64 setsRequireAdministrator):winapp run . --no-build --detach --jsonBefore:
An error occurred trying to start process '...\StarlightGUI.exe' with working directory '...'. The requested operation requires elevation.After:
StarlightGUI.exe requires administrator rights (its manifest sets requireAdministrator). Run winapp from an elevated terminal, or lower the app's UAC execution level for this configuration.AudioPlaybackConnector2 (
N0ahTM/AudioPlaybackConnector2) on an x64 PC:winapp run . -p Platform=ARM64 --detach --jsonBefore (after a 188 s build):
Failed to prepare the Windows App Runtime: The Windows App Runtime (Framework + DDLM) for architecture 'arm64' is not registered and could not be installed, ...After (1.7 s):
AudioPlaybackConnector2.vcxproj targets arm64, which this x64 machine can't run. Run it on an arm64 machine, or build for this machine (-p Platform=x64).FastCopy (
HO-COOH/FastCopy, vcpkg manifest, novcpkg integrate install):winapp run . --project FastCopy --detach --jsonBefore:
Build failed (exit code 1).(aftererror C1083: Cannot open include file: 'boost/container/static_vector.hpp')After:
Build failed for FastCopy.vcxproj. Headers are missing and the project uses vcpkg (vcpkg.json), but vcpkg isn't integrated with MSBuild. Run 'vcpkg integrate install' once (e.g. from a Developer PowerShell), then try again.AudioPlaybackConnector2 imports
vcpkg.targetsitself; it still builds and launches with no hint.Related Issue
Follow-up to #680 / #984.
Type of Change
Checklist
Additional Notes
WinApp.Cli.Testsproject ran 7,335 tests with 0 failures.run .from the solution or project folder,run <vcxproj>,run <sln>,--no-buildand--no-launch.winapp ui screenshot.vcpkg integrate installmakes a persistent user-wide change on this shared machine. Instead, a FastCopy build with vcpkg's props/targets force-imported got past the missing headers.