Skip to content

Fix .NET 10 modern UWP MTP invocation - #11609

Merged
Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/fix-uwp-net10-invocation
Sep 29, 2026
Merged

Amaury Levé (Evangelink) merged 3 commits into
mainfrom
dev/amauryleve/fix-uwp-net10-invocation

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Modern UWP projects targeting .NET 10 can build successfully, but InvokeTestingPlatform rejects their AppX recipe because the .NET 10 tooling packages obj\...\apphost.exe under the published application executable name instead of using the bin\...\<Assembly>.exe path as the recipe source.

Changes

  • Preserve exact recipe source matching, then fall back to the unique executable package path declared by the AppX manifest.
  • Select the packaged net9 app-model controller for net10 UWP consumers, matching the package asset fallback.
  • Retarget the real Modern UWP acceptance asset to net10 and stage its registration inputs in a short physical path so AppX path canonicalization does not make the test depend on checkout length.
  • Add focused launcher and SDK regression coverage.

Validation

  • Focused AppX recipe materialization tests: 3 passed.
  • Debug package build: 0 warnings, 0 errors.
  • Modern UWP net10 acceptance run: both the plain test and UI-thread test passed through InvokeTestingPlatform.

Fixes: #11601

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 28, 2026 18:33
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Sep 28, 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.

Copilot review overview

🟡 Changes recommended

It removes required net9 execution coverage and can delete the registered staging layout when package cleanup fails.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Fixes .NET 10 Modern UWP execution through MTP by resolving packaged executables via the AppX manifest and selecting the compatible net9 controller.

Changes:

  • Adds manifest-based executable fallback and unit coverage.
  • Maps net10 UWP projects to the net9 controller.
  • Retargets and stages the Modern UWP acceptance test.
File Description
PackagedAppTestHostLauncherTests.cs Tests staged apphost resolution.
WindowsApplicationModelTestTools.cs Supports an overridden packaged-app target.
SdkTests.cs Verifies controller TFM selection.
ModernUwpTests.cs Exercises net10 UWP execution from a short path.
PackagedAppTestHostLauncher.cs Adds manifest-guided recipe fallback.
Common.targets Selects the net9 controller for net10.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Sep 28, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Sep 28, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 28, 2026 18:50
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Sep 28, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Sep 28, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Sep 28, 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.

Copilot review overview

🔵 Needs a closer look

The ambiguity-rejection branch needs regression coverage to prevent selecting the wrong application from multi-app packages.

Review effort: Balanced
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Add test rejecting ambiguous manifest matches

src/​Platform/​Microsoft.Testing.Extensions.PackagedApp/​PackagedAppTestHostLauncher.cs:720

The new fallback’s safety depends on rejecting ambiguous manifest matches, but the added test only covers a single application. A package with Apps1\Host.exe and Apps2\Host.exe produces two candidates for a requested Host.exe; if this guard regresses to selecting either candidate, the current unit and acceptance tests still pass while the launcher can activate the wrong AUMID. Please add a materialization test that constructs this shape and asserts that it is rejected.

@github-actions

Copy link
Copy Markdown
Contributor

Preliminary test-triage analysis — Azure Pipelines build 1615087

Triggering check: microsoft.testfx (Build Linux Release). This is partial (early) evidence, and other build legs may still change the conclusion.

Failures on the Linux Release leg (net11.0, MSTest.Acceptance.IntegrationTests)

  • MSTestSdk_UnpackagedWinUIWithExplicitPackagedAppExtension_KeepsDirectLaunch (SdkTests.cs line 1070)
  • MSTestSdk_ConsoleWithExplicitPackagedAppExtension_KeepsDirectLaunch (SdkTests.cs line 1084)

Both fail with the same signature. AssertOutputContains reports "Expected string to contain the specified substring" on the output of dotnet build -restore -t:PrintWindowsTestContract. That command exited with code 0, so the build succeeded. The expected text is missing from its output.

Related signal, different leg (Windows App Model Diagnostics)

  • PackagedWinUI.PackagedWinUITestCases.RetryTestMethod_PassesOnSecondAppContainerHost failed with "The first AppContainer host fails so Retry must activate a second host."
  • I have not confirmed that this is related to the two failures above.

Assessment

  • Confidence: medium-high that this PR causes the two Linux failures. It changes src/Package/MSTest.Sdk/Sdk/Runner/Common.targets, PackagedAppTestHostLauncher.cs, SdkTests.cs and WindowsApplicationModelTestTools.cs. The failing tests sit in the changed area, and a build succeeding while the expected PrintWindowsTestContract output is missing points to a targets/property-condition mismatch.
  • I have no evidence that a retry recovered either failure, so I am not calling them flaky.
  • History coverage is incomplete (early-analysis), so I make no claim about earlier occurrences on main.

Next step

  1. Inspect the PrintWindowsTestContract output in the .binlog for the two failing test assets. Check whether the explicit packaged-app extension case now emits different contract text under net11.0 on Linux.
  2. Update either the expected substrings in SdkTests.cs or the target logic in Common.targets.
  3. Wait for the final resolution once the full build completes.

🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto · 36.5 AIC · ⌖ 6.2 AIC · ⊞ 9.6K

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 28, 2026 20:14
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Sep 28, 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@Evangelink
Amaury Levé (Evangelink) merged commit 1d33ad8 into main Sep 29, 2026
30 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/fix-uwp-net10-invocation branch September 29, 2026 06:52
@github-actions github-actions Bot removed the state/needs-review Awaiting review from the team. label Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modern UWP net10 package builds but InvokeTestingPlatform cannot execute it

2 participants