Skip to content

Fix WinUI MTP samples and per-sample test runner selection - #11103

Open
Amaury Levé (Evangelink) wants to merge 5 commits into
mainfrom
evangelink-sample-mtp-setup
Open

Fix WinUI MTP samples and per-sample test runner selection#11103
Amaury Levé (Evangelink) wants to merge 5 commits into
mainfrom
evangelink-sample-mtp-setup

Conversation

@Evangelink

@Evangelink Amaury Levé (Evangelink) commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Default WinUI sample projects (packaged/unpackaged MTP, VSTest) to x64 so directory-based dotnet test invocations no longer build/launch an ARM64 executable on x64 Windows (e.g. dotnet test .\WinUIMtpUnpackagedApp\ was failing with System.ComponentModel.Win32Exception (216): ... is not a valid application for this OS platform).
  • Remove ARM64 from the WinUI MTP .slnx default configurations so the default solution platform matches the host architecture; ARM64 remains available as an explicit project platform.
  • Mark WinUI MTP sample projects as test projects (IsTestProject=true) for consistent discovery.
  • Add AnyCPU fallback architecture/RID/publish-profile settings for direct WinUI project builds.
  • Configure samples/public/global.json to select the Microsoft.Testing.Platform runner for directory-based dotnet test invocations, with local global.json opt-outs/opt-ins for the VSTest-only and MTP-only samples so each keeps using its intended runner.

Testing

  • dotnet test .\WinUIMtpUnpackagedApp\ (with binlog) - passes (3/3 tests).
  • dotnet test .\WinUIMtpPackagedApp\ (with binlog) - passes (2/2 tests).
  • dotnet build .\WinUIVSTestApp\WinUIVSTestApp.csproj (with binlog) - succeeds.
  • dotnet test in DemoMSTestSdk\ProjectUsingMSTestRunner - uses MTP, passes.
  • dotnet test in DemoMSTestSdk\ProjectUsingVSTest - remains on VSTest, passes.

Follow-up

A UWP + Microsoft.Testing.Platform sample isn't possible yet because the adapter compiles its MTP integration layer out for UWP targets. That is being addressed separately in its own PR; a UWP MTP sample can be added here (or in a follow-up) once it lands.

- Default WinUI sample projects (packaged/unpackaged MTP, VSTest) to x64
  so directory-based dotnet test invocations no longer build/launch an
  ARM64 executable on x64 Windows.
- Remove ARM64 from the WinUI MTP .slnx default configurations.
- Mark WinUI MTP sample projects as test projects for consistent
  discovery.
- Add AnyCPU fallback architecture/RID/publish-profile settings for
  direct WinUI project builds.
- Configure samples/public/global.json to select the Microsoft.Testing.Platform
  runner for directory-based dotnet test invocations, with local
  global.json opt-outs/opt-ins for the VSTest-only and MTP-only samples
  so each keeps using its intended runner.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 8, 2026 06:24

@github-actions github-actions Bot 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Review Summary

Clean samples-only PR that fixes real usability issues (ARM64 binary launch on x64 hosts, missing IsTestProject, missing test runner configuration). No production code, public API, or test changes.

Verdict Table

# Dimension Severity Result
1 Algorithmic Correctness MAJOR N/A — no logic code
2 Threading & Concurrency BLOCKING N/A
3 Security & IPC BLOCKING N/A
4 Public API & Binary Compat BLOCKING N/A — samples only
5 Performance & Allocations MAJOR N/A
6 Cross-TFM Compatibility MAJOR N/A
7 Resource Management MAJOR N/A
8 Error Handling MAJOR N/A
9 Localization MINOR N/A
10 Testing Adequacy MAJOR ✅ Manual testing documented in PR body
11 Code Style & Conventions MINOR ✅ Clean
12 Documentation MINOR ✅ PR body is thorough
13 MSBuild & Build Infra MAJOR ⚠️ See inline comment on ARM64 gap
14 Naming MINOR N/A
15 Logging & Telemetry MINOR N/A
16 Configuration MINOR global.json hierarchy is correct
17 Cancellation MAJOR N/A
18 Backward Compat BLOCKING ✅ Samples only, no shipping code
19 Dependency Management MINOR N/A
20 Scope Discipline MINOR ✅ Single concern
21 Experimental API MINOR N/A
22 PowerShell Hygiene MINOR N/A

Findings

One minor MSBuild concern (inline comment): The AnyCPUx64 fallback in the WinUI .csproj files only handles PROCESSOR_ARCHITECTURE == 'AMD64'. An ARM64 Windows user doing a default dotnet test would still hit the original failure since no ARM64 fallback is provided. This is low severity for sample projects — a comment or matching ARM64 condition would suffice.

Overall this is a well-scoped improvement to sample usability. No blocking issues found.

Comment thread samples/public/WinUIMtpPackagedApp/WinUIMtpPackagedApp.csproj

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.

Copilot review overview

🟡 Changes recommended

The root runner selection unintentionally converts the documented VSTest performance comparison to MTP.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity samples/​public/​global.json — This root setting changes the documented VSTest leg in `samples/public/mstest-runner/runner_vs_vstes…
What changed in this PR

Updates public WinUI samples for x64 defaults and configures directory-scoped test runners.

Changes:

  • Adds x64/AnyCPU fallbacks to WinUI projects.
  • Removes ARM64 from MTP solution defaults.
  • Selects MTP or VSTest through scoped global.json files.
File Description
samples/​public/​WinUIVSTestApp/​WinUIVSTestApp.csproj Adds x64 build fallbacks.
samples/​public/​WinUIVSTestApp/​global.json Selects VSTest.
samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.slnx Removes ARM64 solution configuration.
samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.csproj Adds x64 fallbacks and test discovery.
samples/​public/​WinUIMtpPackagedApp/​WinUIMtpPackagedApp.slnx Removes ARM64 solution configuration.
samples/​public/​WinUIMtpPackagedApp/​WinUIMtpPackagedApp.csproj Adds x64 fallbacks and test discovery.
samples/​public/​UwpVSTestApp/​global.json Selects VSTest.
samples/​public/​global.json Selects MTP for public samples.
samples/​public/​DemoMSTestSdk/​ProjectWithNativeAOT/​global.json Selects MTP and pins MSTest SDK.
samples/​public/​DemoMSTestSdk/​ProjectUsingVSTest/​global.json Selects VSTest and pins MSTest SDK.
samples/​public/​DemoMSTestSdk/​ProjectUsingPlaywright/​global.json Selects MTP and pins MSTest SDK.
samples/​public/​DemoMSTestSdk/​ProjectUsingMSTestRunner/​global.json Selects MTP and pins MSTest SDK.
samples/​public/​DemoMSTestSdk/​ProjectUsingAspire/​global.json Selects MTP and pins MSTest SDK.

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

Comment thread samples/public/global.json
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>

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.

Copilot review overview

🔵 Needs a closer look

The default runner breaks a documented VSTest comparison, and two WinUI projects have incomplete ARM64 AnyCPU fallbacks.

Review tier: Balanced
Findings: 1 Medium severity

Pre-existing issues (1)
Severity Finding
Medium severity samples/​public/​global.json — This root setting changes the documented VSTest leg in `samples/public/mstest-runner/runner_vs_vstes… View comment
Suppressed comments (3)

Previously missed (2) — in code that hasn't changed since the last review.

samples/public/WinUIMtpUnpackagedApp/WinUIMtpUnpackagedApp.csproj:11

  • The AnyCPU fallback handles only AMD64, so a direct build on native ARM64 leaves this WinUI executable as AnyCPU with no RID despite ARM64 being an advertised project platform. Add the corresponding ARM64/win-arm64 assignments, as the packaged MTP project already does.
    samples/public/WinUIVSTestApp/WinUIVSTestApp.csproj:14
  • The AnyCPU fallback is incomplete on native ARM64. In that case none of these AMD64-only assignments runs, leaving PlatformTarget/RuntimeIdentifier unresolved and PublishProfile set to the nonexistent win-AnyCPU.pubxml, even though this project advertises ARM64 and contains win-arm64.pubxml. Mirror the ARM64 mappings used by the packaged MTP sample.

samples/public/global.json:4

  • This repository-wide runner default changes the documented VSTest leg of samples/public/mstest-runner/runner_vs_vstest: that directory has no nearer global.json, and its README invokes dotnet test specifically to measure VSTest. On .NET 10+, this setting makes that command use Microsoft.Testing.Platform instead, so the sample no longer performs the comparison it advertises. Add a VSTest-scoped global.json for that sample (or narrow this default's scope).
  "test": {
    "runner": "Microsoft.Testing.Platform"
  },

Copilot AI review requested due to automatic review settings September 8, 2026 07:20

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.

Copilot review overview

🟡 Changes recommended

Two WinUI samples omit ARM64 AnyCPU fallbacks, leaving native ARM64 direct builds incompletely configured.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 2 High severity · 1 Medium severity

New issues introduced by this change (2)
Severity Finding
High severity samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.csproj — On a native ARM64 host, a direct invocation that evaluates Platform as AnyCPU matches none of…
High severity samples/​public/​WinUIVSTestApp/​WinUIVSTestApp.csproj — The AnyCPU fallback only covers AMD64 here. With a native ARM64 SDK, Platform=AnyCPU leaves…
Pre-existing issues (1)
Severity Finding
Medium severity samples/​public/​global.json — This root setting changes the documented VSTest leg in `samples/public/mstest-runner/runner_vs_vstes… View comment

Comment thread samples/public/WinUIMtpUnpackagedApp/WinUIMtpUnpackagedApp.csproj
Comment thread samples/public/WinUIVSTestApp/WinUIVSTestApp.csproj
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Pipeline Test Triage — Final Analysis

Build: [1586775]((dev.azure.com/redacted) (result: failed, completed) · Check: microsoft.testfx

Conclusion: No test-level defect — root cause is a build/compilation failure (out of scope for this agent)

The only two "failed" test records in the 31,742-test result set are:

  • MSTest.Acceptance.IntegrationTests.WindowsApplicationModelPackageTests.PackedMSTestTestAdapter_ContainsRequiredWindowsApplicationModelAssets
  • MSTest.Acceptance.IntegrationTests.WindowsApplicationModelPackageTests.PackedMSTestTestFramework_ContainsRequiredWindowsApplicationModelAssets

Both fail with the same message:

System.InvalidOperationException: Was expecting to find a single NuGet package named 'MSTest.TestFramework.' in 'D:\a\_work\1\s\artifacts\packages\Release\Shipping', but found 0: '.

This is a downstream consequence, not an independent test defect: the Windows Release and Windows Debug legs both failed earlier in the Build task with:

error RS0017: Symbol 'Microsoft.VisualStudio.TestTools.UnitTesting.TestApplicationBuilderExtensions' is part of the declared API, but is either not public or could not be found
error RS0017: Symbol 'Microsoft.VisualStudio.TestTools.UnitTesting.TestingPlatformBuilderHook' is part of the declared API, but is either not public or could not be found
... (AddMSTest / AddExtensions members, same file)

sourced from src/Adapter/MSTest.TestAdapter/PublicAPI/uwp/PublicAPI.Unshipped.txt. Because the Release build did not complete, no MSTest.TestFramework.* NuGet package was produced under artifacts/packages/Release/Shipping, so the packaged-asset acceptance tests in the Windows application-model acceptance job failed for lack of an artifact to inspect — not because of any behavioral regression in the tests themselves.

Confidence: High. The RS0017 analyzer errors are deterministic public-API-tracking mismatches (uwp PublicAPI.Unshipped.txt entries not matching the currently declared/public surface for TestApplicationBuilderExtensions/TestingPlatformBuilderHook), consistent with this PR's changes touching src/Adapter/MSTest.TestAdapter/InternalAPI/uwp/InternalAPI.Unshipped.txt, .../PublicAPI/uwp/PublicAPI.Unshipped.txt, and the TestingPlatformAdapter sources.

History: In the 12 prior completed builds sampled (last 30 days, history.json), both ContainsRequiredWindowsApplicationModelAssets tests passed (or were skipped on non-Windows legs) whenever they ran — no prior occurrence of this failure signature was found, consistent with it being tied to this PR's uwp PublicAPI changes rather than a pre-existing/flaky condition.

Scope note: Per this agent's charter, ordinary compilation/PublicAPI-analyzer build failures are owned by Build Failure Analysis, not Pipeline Test Triage. No issue is being created here; the actionable next step is to reconcile src/Adapter/MSTest.TestAdapter/PublicAPI/uwp/PublicAPI.Unshipped.txt (and the paired InternalAPI.Unshipped.txt) with the actual public surface of TestApplicationBuilderExtensions.AddMSTest and TestingPlatformBuilderHook.AddExtensions for the uwp target framework.

No issue created — this is a build-configuration/API-tracking problem specific to this PR's change, not a recurring or flaky test defect.

🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · auto · 67.5 AIC · ⌖ 1.85 AIC · ⊞ 9.3K · [◷]( · )

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Build failure analysis

Result: Genuine build failure — not a non-build/test failure.

Root cause

The Windows Debug and Release build legs fail with a Roslyn public-API analyzer error (RS0017, "symbol is part of the declared API, but is either not public or could not be found") in MSTest.TestAdapter.csproj, specifically for the legacy uap10.0.16299 (UwpMinimum) target framework:

error RS0017: Symbol 'TestApplicationBuilderExtensions' is part of the declared API, but is either not public or could not be found
error RS0017: Symbol 'TestApplicationBuilderExtensions.AddMSTest(...)' is part of the declared API, but is either not public or could not be found
error RS0017: Symbol 'TestingPlatformBuilderHook' is part of the declared API, but is either not public or could not be found
error RS0017: Symbol 'TestingPlatformBuilderHook.AddExtensions(...)' is part of the declared API, but is either not public or could not be found

This is exactly the risk the PR description itself calls out — the legacy uap10.0.16299 TFM "couldn't be rebuilt in this sandbox" and was only verified "by inspection."

Why it happens:

  • MSTest.TestAdapter.csproj adds a new MTP_UWP_SUPPORTED define, only set when TargetFramework == $(ModernUwpMinimum) (net9.0-windows10.0.17763.0). The TestingPlatformAdapter/ MTP integration types (TestApplicationBuilderExtensions, TestingPlatformBuilderHook, etc.) are guarded by #if !WINDOWS_UWP || MTP_UWP_SUPPORTED, so they only compile for modern UWP — correctly excluded from legacy uap10.0.16299.
  • However, the new entries for these types were added to src/Adapter/MSTest.TestAdapter/PublicAPI/uwp/PublicAPI.Unshipped.txt (and similarly a large batch in InternalAPI/uwp/InternalAPI.Unshipped.txt), and that file is wired into both TFMs via a single shared condition in the csproj:
    <AdditionalFiles Include="PublicAPI\uwp\PublicAPI.Unshipped.txt" Condition=" '$(TargetFramework)' == '$(UwpMinimum)' OR '$(TargetFramework)' == '$(ModernUwpMinimum)' " />
    <AdditionalFiles Include="InternalAPI\uwp\InternalAPI.Unshipped.txt" Condition=" '$(TargetFramework)' == '$(UwpMinimum)' OR '$(TargetFramework)' == '$(ModernUwpMinimum)' " />
  • So when the analyzer runs for uap10.0.16299 (where MTP_UWP_SUPPORTED is never defined), the file declares symbols that were never compiled for that TFM → RS0017.

Confirmed via binlog: the failing CoreCompile invocation in leg 2_0_Logs_Build_Windows_Debug_Debug.binlog (TargetFramework=uap10.0.16299, project MSTest.TestAdapter.csproj) shows these 4 errors and "Build failed."; all other 17 legs (11 WindowsSamples Release legs, Linux Release, macOS Release, 2 application-model acceptance legs, and the other TFM evaluations of the adapter itself: net462, net8.0, net9.0, net8.0-windows10.0.18362.0 WinUI, net9.0-windows10.0.17763.0 modern UWP) compiled cleanly.

Suggested fix

Split the shared uwp/*.Unshipped.txt (and, if needed, Shipped.txt) files so the new MTP-related symbols are only declared for the TFM that actually compiles them — e.g. add a separate PublicAPI/modern-uwp/PublicAPI.Unshipped.txt (and matching InternalAPI/modern-uwp/...) containing only the net9.0-windows10.0.17763.0-specific additions, and change the AdditionalFiles conditions so ModernUwpMinimum picks up the new file while UwpMinimum keeps referencing the original (unmodified) shared file. Equivalently, the combined '$(TargetFramework)' == '$(UwpMinimum)' OR '$(TargetFramework)' == '$(ModernUwpMinimum)' condition on those two AdditionalFiles entries needs to become TFM-specific to match where the new symbols are actually compiled.

Scope check

All 18 build legs were inspected (GH_AW_MISSING_LEGS was empty, so this is a complete picture): only the Windows Debug and Windows Release legs fail, both for the same root cause on the same TFM (uap10.0.16299).

🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 176 AIC · ⌖ 2.03 AIC · ⊞ 13.4K · [◷]( · )

@github-actions github-actions Bot 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.

🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 176 AIC · ⌖ 2.03 AIC · ⊞ 13.4K ·

Comment thread src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj Outdated
Copilot AI review requested due to automatic review settings September 8, 2026 08:59

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.

Copilot review overview

🔵 Needs a closer look

The public-samples runner default unintentionally routes the documented VSTest benchmark through MTP.

Review tier: Balanced
Findings: 2 High severity · 1 Medium severity

Pre-existing issues (3)
Severity Finding
High severity samples/​public/​WinUIVSTestApp/​WinUIVSTestApp.csproj — The AnyCPU fallback only covers AMD64 here. With a native ARM64 SDK, Platform=AnyCPU leaves… View comment
High severity samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.csproj — On a native ARM64 host, a direct invocation that evaluates Platform as AnyCPU matches none of… View comment
Medium severity samples/​public/​global.json — This root setting changes the documented VSTest leg in `samples/public/mstest-runner/runner_vs_vstes… View comment
Suppressed comments (1)

samples/public/global.json:3

  • This directory-wide setting also changes the documented VSTest benchmark under samples/public/mstest-runner/runner_vs_vstest: its README runs dotnet test <FOLDER_TO_TEST> specifically as the VSTest side of the comparison, but .NET 10 resolves this parent global.json and will now route that command through Microsoft.Testing.Platform. Add a nearer VSTest runner configuration for that benchmark (or otherwise scope this default away from it) so the sample still measures the two different runners.
    "runner": "Microsoft.Testing.Platform"

…comparison

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 8, 2026 10:29

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.

Copilot review overview

🟡 Changes recommended

The three WinUI AnyCPU fallback paths omit the supported native x86 architecture.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 3 Medium severity

New issues introduced by this change (3)
Severity Finding
Medium severity samples/​public/​WinUIMtpPackagedApp/​WinUIMtpPackagedApp.csproj — The AnyCPU fallback omits native x86. When PROCESSOR_ARCHITECTURE=x86, the target/RID remain…
Medium severity samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.csproj — The AnyCPU fallback still has no native x86 branch. On a 32-bit Windows host,…
Medium severity samples/​public/​WinUIVSTestApp/​WinUIVSTestApp.csproj — The AnyCPU fallback omits native x86. When PROCESSOR_ARCHITECTURE=x86, the target/RID remain…
Issues resolved since last review (3)
Severity Finding
High severity samples/​public/​WinUIVSTestApp/​WinUIVSTestApp.csproj — The AnyCPU fallback only covers AMD64 here. With a native ARM64 SDK, Platform=AnyCPU leaves… View resolved comment
High severity samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.csproj — On a native ARM64 host, a direct invocation that evaluates Platform as AnyCPU matches none of… View resolved comment
Medium severity samples/​public/​global.json — This root setting changes the documented VSTest leg in `samples/public/mstest-runner/runner_vs_vstes… View resolved comment

Comment thread samples/public/WinUIMtpPackagedApp/WinUIMtpPackagedApp.csproj
Comment thread samples/public/WinUIMtpUnpackagedApp/WinUIMtpUnpackagedApp.csproj
Comment thread samples/public/WinUIVSTestApp/WinUIVSTestApp.csproj
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 8, 2026 10:41

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.

Copilot review overview

🔵 Needs a closer look

The VSTest solution still defaults directory-based invocations to ARM64.

Review tier: Balanced
Findings: None

Issues resolved since last review (3)
Severity Finding
Medium severity samples/​public/​WinUIVSTestApp/​WinUIVSTestApp.csproj — The AnyCPU fallback omits native x86. When PROCESSOR_ARCHITECTURE=x86, the target/RID remain… View resolved comment
Medium severity samples/​public/​WinUIMtpUnpackagedApp/​WinUIMtpUnpackagedApp.csproj — The AnyCPU fallback still has no native x86 branch. On a 32-bit Windows host,… View resolved comment
Medium severity samples/​public/​WinUIMtpPackagedApp/​WinUIMtpPackagedApp.csproj — The AnyCPU fallback omits native x86. When PROCESSOR_ARCHITECTURE=x86, the target/RID remain… View resolved comment
Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

samples/public/WinUIVSTestApp/WinUIVSTestApp.csproj:8

  • This project-level default does not fix directory-based dotnet test for the VSTest sample. That invocation discovers WinUIVSTestApp.sln, whose first/default configuration is still Debug|ARM64 (WinUIVSTestApp.sln:9-15); the solution then supplies Platform=ARM64 as a global property, so this empty-value condition cannot replace it and x64 Windows can still build/launch the ARM64 app. Update the solution configurations so x64 is the default (as done for both MTP .slnx files), while retaining ARM64 as an explicit project platform.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 8, 2026 10:53
@Evangelink

Copy link
Copy Markdown
Member Author

This project-level default does not fix directory-based dotnet test for the VSTest sample. That invocation discovers WinUIVSTestApp.sln, whose first/default configuration is still Debug|ARM64 [...] the solution then supplies Platform=ARM64 as a global property, so this empty-value condition cannot replace it and x64 Windows can still build/launch the ARM64 app.

Good catch, and confirmed. I reproduced it with -t:ValidateSolutionConfiguration -v:diag: the solution was emitting Debug|ARM64 and passing Platform=ARM64 as a global property, which is exactly the Win32Exception 216 this PR set out to fix, still live in the VSTest sample.

Fixed in b8ff3a1 by reordering SolutionConfigurationPlatforms so x64 comes first, keeping ARM64 and x86 as explicit platforms rather than removing them. UwpVSTestApp.sln had the identical problem (it defaulted to Debug|arm64), so I fixed it too. Both solutions now resolve to Debug|x64 by default, and -p:Platform=ARM64 / -p:Platform=x86 still select those configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants