Skip to content

Honor -p:Configuration for C++ projects in winapp run - #1085

Merged
Nikola Metulev (nmetulev) merged 6 commits into
mainfrom
nmetulev-fix-run-vcxproj-configuration-property
Oct 16, 2026
Merged

Nikola Metulev (nmetulev) merged 6 commits into
mainfrom
nmetulev-fix-run-vcxproj-configuration-property

Conversation

@nmetulev

Copy link
Copy Markdown
Member

What and why

Visual Studio users often pick the build configuration with -p:Configuration=Release. On a C++ .vcxproj, winapp run ignored that property and used Debug. With --no-build, it then looked for the Debug output instead of the Release build you asked for.

Now -p:Configuration=X on a .vcxproj works like -c X, the same way -p:Platform already picks the architecture. If you pass both -c and -p:Configuration with different values, winapp stops before building and tells you to pass only one. .NET projects don't change.

Fixes #1075

Before / after

The command runs against a stub AppHost.vcxproj that hasn't been built, so both runs end with "executable not found". The header line and the path winapp looks for show the difference.

Before (main): Debug | arm64, looking in ARM64\Debug

before

After (this branch): Release | arm64, looking in ARM64\Release. Conflicting -c and -p:Configuration values fail with one line.

after

Not tested / risks

I only tested on a stub .vcxproj, not on a full C++ app build.

Checklist

  • Tests added or updated
  • Tested locally on Windows
  • Docs, samples, and plugins/winapp/skills/ updated if user-facing behavior changed
Notes for reviewers
  • Configuration names are compared case-insensitively, so -c release -p:Configuration=Release is allowed.
  • Choosing which project to run in a folder or solution doesn't depend on the configuration for C++ projects, so that step didn't need this change.

On a .vcxproj, -p:Configuration=Release was dropped and the run used Debug.
It now selects the configuration like -c; -c and -p Configuration with
different values fail before building.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 18:54
@nmetulev Nikola Metulev (nmetulev) added the agent-preparing Agent is addressing feedback or completing required validation and CI label Oct 14, 2026
@nmetulev Nikola Metulev (nmetulev) added agent-blocked Agent cannot address feedback or fix CI without help, or needs author input and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation matches the issue requirements, and the Release build, targeted tests, and CLI scenarios passed.

0 open findings

What changed in this PR

This PR makes winapp run honor -p:Configuration for C++ projects while preserving .NET behavior.

Changes:

  • Resolves C++ configuration from -p Configuration=X.
  • Rejects conflicting -c and -p Configuration values.
  • Adds tests and updates C++ usage documentation.
File Description
ProjectRunService.Cpp.cs Extracts and forwards the effective C++ configuration.
RunCommand.ProjectMode.cs Applies configuration precedence and conflict validation.
RunCommandProjectModeTests.cs Tests selection and conflict behavior.
ProjectRunServiceCppTests.cs Tests property parsing and MSBuild tokens.
docs/​usage.md Documents C++ configuration selection.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nmetulev Nikola Metulev (nmetulev) added agent-preparing Agent is addressing feedback or completing required validation and CI and removed agent-blocked Agent cannot address feedback or fix CI without help, or needs author input labels Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Build Metrics Report

Validation passed. All required build and validation jobs succeeded.

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 59.54 MB 59.54 MB 📈 +0.5 KB (+0.00%)
CLI (x64) 59.52 MB 59.52 MB 📈 +1.0 KB (+0.00%)
MSIX (ARM64) 24.72 MB 24.72 MB 📈 +0.9 KB (+0.00%)
MSIX (x64) 26.23 MB 26.23 MB 📈 +1.7 KB (+0.01%)
NPM Package 51.57 MB 51.57 MB 📈 +0.5 KB (+0.00%)
NuGet Package 51.68 MB 51.68 MB 📈 +1.0 KB (+0.00%)

.NET Test Results (TRX reports)

Other suites are reflected in the overall validation status above.

✅ 8801 passed, 39 skipped out of 8840 tests in 1695.2s (+5 tests, +11.1s vs. baseline)

Test Coverage

✅ 87.6% line coverage, 82% branch coverage · ✅ no change vs. baseline

CLI Startup Time

59ms median (x64, winapp --version) · 📉 -12ms vs. baseline

Try This Build

Installs 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))) 1085
Switching between builds often?

Put the tool on your PATH once:

& ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPath

Then this build is just:

winapp-pr 1085

Run winapp-pr with no arguments to pick from a list of open PRs.


Updated 2026-10-16 00:07:45 UTC · commit 16633a4 · workflow run

@nmetulev Nikola Metulev (nmetulev) added ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Oct 14, 2026
@nmetulev Nikola Metulev (nmetulev) added agent-preparing Agent is addressing feedback or completing required validation and CI and removed ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge labels Oct 14, 2026
@nmetulev Nikola Metulev (nmetulev) added ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Oct 15, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1505c85e-cfaf-4e5f-ba25-3305180259fb
@nmetulev Nikola Metulev (nmetulev) added agent-preparing Agent is addressing feedback or completing required validation and CI and removed ready-for-review Agent work and technical checks complete; awaiting review or re-review, not approval or merge labels Oct 15, 2026
@nmetulev
Nikola Metulev (nmetulev) merged commit 0eab9be into main Oct 16, 2026
70 of 73 checks passed
@nmetulev
Nikola Metulev (nmetulev) deleted the nmetulev-fix-run-vcxproj-configuration-property branch October 16, 2026 00:14
Nikola Metulev (nmetulev) added a commit that referenced this pull request Oct 16, 2026
Conflict in docs/usage.md (C++ run notes): kept the DevTools line and main's -c / -p:Configuration line from #1085.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-preparing Agent is addressing feedback or completing required validation and CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: winapp run <app>.vcxproj -p:Configuration=Release is ignored and runs Debug

3 participants