Packaged WinUI dotnet test activation loses the execution ID
@Evangelink is already working on this.
Since Sep 24, 2026.
Assessment
This issue has not been assessed yet.
Description
Describe the bug
Native .NET 10 dotnet test can register and AUMID-activate a packaged WinUI test application successfully, but discovery never starts and the run completes with 0 tests because the controller and activated host use different TESTINGPLATFORM_DOTNETTEST_EXECUTIONID values.
DotnetTestConnection creates TESTINGPLATFORM_DOTNETTEST_EXECUTIONID when it is absent and sends that value in the native dotnet-test handshake. PackagedAppTestHostLauncher.GetConnectBackEnvironment explicitly forwards controller/retry/report correlation variables across the AUMID activation boundary, but currently omits this execution ID. An AUMID-activated process does not inherit the controller environment, so the activated host generates a new GUID and the protocol rejects or fails to associate the connection.
Version used
- MSTest.Sdk 4.4.1
- Microsoft.Testing.Extensions.PackagedApp 2.4.1 (stable Windows asset selected with
MicrosoftTestingExtensionsPackagedAppVersion=2.4.1) - .NET 10 SDK selected by
global.json global.jsontest runner:Microsoft.Testing.Platform- Windows x64 packaged WinUI 3 test application
- The same omission is present on current
main
Steps To Reproduce
-
Create a WinUI 3 packaged test application that uses MSTest.Sdk and includes a generated
AppxManifest.xmlfor an x64 full-trust application. -
Select native Microsoft.Testing.Platform
dotnet testinglobal.json. -
Pin/override
Microsoft.Testing.Extensions.PackagedAppto stable version 2.4.1. -
Clear stale package registrations and test-host processes.
-
Run:
dotnet test --project <packaged.csproj> -c Release -a x64 --diag <diagnostics-path> -bl:<binlog-path> -
Observe that the Windows PackagedApp asset is resolved, the development package is registered, and the intended x64 executable is activated by its exact AUMID.
-
Compare the controller and activated-host diagnostics/handshake payloads: the controller execution ID differs from the child-generated execution ID.
-
Observe that native dotnet-test discovery never starts and the run reports 0 tests.
Control cases:
dotnet runsucceeds with package identity and AUMID activation.- An unpackaged WinUI
dotnet testsucceeds. - A loose-copy launch is not an acceptable packaged-app validation because it bypasses package identity and AUMID activation.
Expected behavior
The explicit PackagedApp connect-back handoff preserves the controller's TESTINGPLATFORM_DOTNETTEST_EXECUTIONID across AUMID activation. The activated packaged host uses the same execution ID, connects to the native .NET 10 dotnet-test controller, discovers and executes tests, publishes results, exits cleanly, and leaves no stale registration or handoff file.
Actual behavior
Registration and AUMID activation succeed, but the activated host does not receive TESTINGPLATFORM_DOTNETTEST_EXECUTIONID. It generates a different GUID, the controller cannot associate the handshake with the intended execution, and the run finishes with 0 discovered tests.
Additional context
Root-cause hypothesis: add TESTINGPLATFORM_DOTNETTEST_EXECUTIONID to the existing explicit safe connect-back environment allowlist used by PackagedAppTestHostLauncher.GetConnectBackEnvironment, preferably via the shared internal environment-variable constant where project references permit it. Do not broaden the handoff to arbitrary environment propagation.
Security/data-handling invariant: only protocol metadata required for connect-back and correlation should cross the AUMID boundary. Test filters, inline runsettings, credentials, and unrelated or secret environment values must remain excluded. The LocalState handoff must remain one-shot and be deleted after consumption or failed activation cleanup.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 312
- Avg merge
- 8h 14m
- Merged PRs (30d)
- 497
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/testfx
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
agentic-workflows area/performance type/automation
Difficulty 2/5 1-3 hours Newbie friendliness 15/100
-
[file-diet] Refactor AzureDevOpsTestResultsPublisher.cs (578 lines) into focused partial-class files Opentype/automation type/tech-debt
-
area/mtp needs/triage
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
type/automation type/tech-debt
Difficulty 5/5 Over a week Newbie friendliness 10/100
All issues in microsoft/testfx
Similar issues
-
untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13095 ·
-
area-deployment area-integrations triage:bot-seen
Difficulty 2/5 Half a day Newbie friendliness 86/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
newrelic/newrelic-dotnet-agent#3850 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
LuckyPennySoftware/AutoMapper#4660 ·
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr issue-rating: 🌊 off-meta tidepool P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/openclaw-windows-packaging#116 · 1 comment · 1 reaction ·