Uh oh!
There was an error while loading. Please reload this page.
Clarify UWP and WinUI testing samples - #10887
Conversation
Rename and organize the UWP and WinUI samples by test host and packaging mode. Make the MTP samples runnable through dotnet run and native dotnet test, and route packaged VSTest samples through Visual Studio AppX recipes from dotnet test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 480f07f9-4248-4ef6-83aa-9fae4ca1b5a7
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
samples/public/README.md — This MTP command uses the native dotnet test --project syntax, which is available only in .NET… |
What changed in this PR
Clarifies supported UWP/WinUI testing combinations by organizing samples around application model, host, and packaging mode.
Changes:
- Renames and flattens four Windows application samples.
- Adds VSTest AppX-recipe execution and native MTP configuration.
- Updates acceptance tests and documentation.
| File | Description |
|---|---|
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/WindowsApplicationModelTestTools.cs | Uses renamed UWP assets. |
test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/PackagedWinUITests.cs | Uses relocated packaged WinUI assets. |
samples/public/WinUIVSTestApp/WinUIVSTestApp.sln | Renames the WinUI VSTest project. |
samples/public/WinUIVSTestApp/WinUIVSTestApp.csproj | Configures AppX-based VSTest execution. |
samples/public/WinUIVSTestApp/UnitTests.cs | Updates the test namespace. |
samples/public/WinUIVSTestApp/UnitTestAppWindow.xaml.cs | Updates the window namespace. |
samples/public/WinUIVSTestApp/UnitTestAppWindow.xaml | Updates WinUI type references. |
samples/public/WinUIVSTestApp/UnitTestApp.xaml.cs | Updates the application namespace. |
samples/public/WinUIVSTestApp/UnitTestApp.xaml | Updates WinUI type references. |
samples/public/WinUIVSTestApp/Properties/PublishProfiles/win-x86.pubxml | Adds x86 publishing settings. |
samples/public/WinUIVSTestApp/Properties/PublishProfiles/win-x64.pubxml | Adds x64 publishing settings. |
samples/public/WinUIVSTestApp/Properties/PublishProfiles/win-arm64.pubxml | Adds ARM64 publishing settings. |
samples/public/WinUIVSTestApp/Properties/launchSettings.json | Adds packaged launch configuration. |
samples/public/WinUIVSTestApp/Package.appxmanifest | Renames package metadata. |
samples/public/WinUIVSTestApp/Assets/Wide310x150Logo.scale-200.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/Assets/StoreLogo.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/Assets/Square44x44Logo.scale-200.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/Assets/Square150x150Logo.scale-200.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/Assets/SplashScreen.scale-200.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/Assets/LockScreenLogo.scale-200.png | Supplies package artwork. |
samples/public/WinUIVSTestApp/app.manifest | Renames assembly identity. |
samples/public/WinUIMtpUnpackagedApp/WinUIMtpUnpackagedApp.slnx | Flattens the solution layout. |
samples/public/WinUIMtpUnpackagedApp/WinUIMtpUnpackagedApp.csproj | Renames the project namespace. |
samples/public/WinUIMtpUnpackagedApp/UnitTests.cs | Updates the test namespace. |
samples/public/WinUIMtpUnpackagedApp/UnitTestAppWindow.xaml.cs | Updates the window namespace. |
samples/public/WinUIMtpUnpackagedApp/UnitTestAppWindow.xaml | Updates WinUI type references. |
samples/public/WinUIMtpUnpackagedApp/UnitTestApp.xaml.cs | Updates the application namespace. |
samples/public/WinUIMtpUnpackagedApp/UnitTestApp.xaml | Updates WinUI type references. |
samples/public/WinUIMtpUnpackagedApp/Properties/launchSettings.json | Renames the launch profile. |
samples/public/WinUIMtpUnpackagedApp/global.json | Selects native MTP execution. |
samples/public/WinUIMtpUnpackagedApp/app.manifest | Renames assembly identity. |
samples/public/WinUIMtpPackagedApp/WinUIMtpPackagedApp.slnx | Flattens the solution layout. |
samples/public/WinUIMtpPackagedApp/WinUIMtpPackagedApp.csproj | Enables self-contained Windows App SDK deployment. |
samples/public/WinUIMtpPackagedApp/UnitTests.cs | Updates the test namespace. |
samples/public/WinUIMtpPackagedApp/UnitTestAppWindow.xaml.cs | Updates the window namespace. |
samples/public/WinUIMtpPackagedApp/UnitTestAppWindow.xaml | Updates WinUI type references. |
samples/public/WinUIMtpPackagedApp/UnitTestApp.xaml.cs | Updates the MTP entry-point reference. |
samples/public/WinUIMtpPackagedApp/UnitTestApp.xaml | Updates WinUI type references. |
samples/public/WinUIMtpPackagedApp/Properties/PublishProfiles/win-x86.pubxml | Adds x86 publishing settings. |
samples/public/WinUIMtpPackagedApp/Properties/PublishProfiles/win-x64.pubxml | Adds x64 publishing settings. |
samples/public/WinUIMtpPackagedApp/Properties/PublishProfiles/win-arm64.pubxml | Adds ARM64 publishing settings. |
samples/public/WinUIMtpPackagedApp/Properties/launchSettings.json | Separates MTP and package launch profiles. |
samples/public/WinUIMtpPackagedApp/Package.appxmanifest | Renames package metadata. |
samples/public/WinUIMtpPackagedApp/global.json | Selects native MTP execution. |
samples/public/WinUIMtpPackagedApp/Assets/Wide310x150Logo.scale-200.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/Assets/StoreLogo.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/Assets/Square44x44Logo.scale-200.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/Assets/Square150x150Logo.scale-200.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/Assets/SplashScreen.scale-200.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/Assets/LockScreenLogo.scale-200.png | Supplies package artwork. |
samples/public/WinUIMtpPackagedApp/app.manifest | Renames assembly identity. |
samples/public/UwpVSTestApp/UwpVSTestApp.sln | Renames the UWP solution. |
samples/public/UwpVSTestApp/UwpVSTestApp.csproj | Configures UWP VSTest execution. |
samples/public/UwpVSTestApp/UnitTests.cs | Adds package and UI-thread tests. |
samples/public/UwpVSTestApp/Properties/PublishProfiles/win-x86.pubxml | Adds x86 publishing settings. |
samples/public/UwpVSTestApp/Properties/PublishProfiles/win-x64.pubxml | Adds x64 publishing settings. |
samples/public/UwpVSTestApp/Properties/PublishProfiles/win-arm64.pubxml | Adds ARM64 publishing settings. |
samples/public/UwpVSTestApp/Properties/launchSettings.json | Renames the package launch profile. |
samples/public/UwpVSTestApp/Package.appxmanifest | Configures the UWP VSTest application. |
samples/public/UwpVSTestApp/MainPage.xaml.cs | Updates the page namespace. |
samples/public/UwpVSTestApp/MainPage.xaml | Updates UWP type references. |
samples/public/UwpVSTestApp/Assets/Wide310x150Logo.scale-200.png | Supplies package artwork. |
samples/public/UwpVSTestApp/Assets/StoreLogo.png | Supplies package artwork. |
samples/public/UwpVSTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png | Supplies package artwork. |
samples/public/UwpVSTestApp/Assets/Square44x44Logo.scale-200.png | Supplies package artwork. |
samples/public/UwpVSTestApp/Assets/Square150x150Logo.scale-200.png | Supplies package artwork. |
samples/public/UwpVSTestApp/Assets/SplashScreen.scale-200.png | Supplies package artwork. |
samples/public/UwpVSTestApp/Assets/LockScreenLogo.scale-200.png | Supplies package artwork. |
samples/public/UwpVSTestApp/App.xaml.cs | Updates the application namespace. |
samples/public/UwpVSTestApp/App.xaml | Updates UWP type references. |
samples/public/README.md | Documents the sample matrix and commands. |
samples/public/mstest-runner/MSTestRunnerWinUI/MSTestRunnerWinUI/Properties/launchSettings.json | Removes the legacy launch profiles. |
samples/public/Directory.Build.targets | Builds and runs Windows AppX VSTest recipes. |
samples/public/BlankUwpNet9App/UnitTests.cs | Removes the superseded UWP tests. |
samples/public/BlankUwpNet9App/BlankUwpNet9App.csproj | Removes the superseded project. |
docs/winui-testing.md | Links all four renamed samples. |
docs/RFCs/017-TestHost-Launcher.md | Updates the packaged sample reference. |
Suppressed comments (1)
samples/public/UwpVSTestApp/UwpVSTestApp.sln:6
- Renaming this solution leaves
eng/build-samples.ps1:67checking only forBlankUwpNet9App.sln. The renamed UWP sample therefore falls into the ordinarydotnet buildbranch even though that script explicitly routes UWP projects through Visual Studio MSBuild, so the Samples CI job will use the wrong build path. Update the script predicate to recognizeUwpVSTestApp.sln(or detect UWP projects structurally).
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Uh oh!
There was an error while loading. Please reload this page.
Document the .NET SDK 10 prerequisite for native MTP dotnet test and keep the renamed UWP sample on the Visual Studio MSBuild path in Samples CI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 480f07f9-4248-4ef6-83aa-9fae4ca1b5a7
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
samples/public/README.md — This MTP command uses the native dotnet test --project syntax, which is available only in .NET… View resolved comment |
The previous Windows Release job timed out after broad acceptance-test stalls while the Windows application-model and samples jobs passed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 480f07f9-4248-4ef6-83aa-9fae4ca1b5a7
The prior run hit an unrelated Timeout_BoundsBlockingDisposalWithoutRetryingIt flake; all changed-area Windows sample and application-model jobs passed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 480f07f9-4248-4ef6-83aa-9fae4ca1b5a7
Previous Windows Release attempts timed out on unrelated process-based acceptance tests across distinct agents; changed-area jobs passed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 480f07f9-4248-4ef6-83aa-9fae4ca1b5a7
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
samples/public/Directory.Build.targets — The nested invocation always restores and builds, so the standard dotnet test --no-build and… | |
samples/public/Directory.Build.targets — This replacement VSTest invocation forwards only filter, logger, results directory, and list-tests.… |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Capture no-build and restore intent separately from the suppressed SDK prebuild, forward the complete user-facing VSTest option set through a session-specific response file, and clean temporary files on success, failure, and Clean. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 480f07f9-4248-4ef6-83aa-9fae4ca1b5a7
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
samples/public/Directory.Build.targets — This replacement VSTest invocation forwards only filter, logger, results directory, and list-tests.… View resolved comment | |
samples/public/Directory.Build.targets — The nested invocation always restores and builds, so the standard dotnet test --no-build and… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
samples/public/README.md:35
- These commands inherit the repository-root
global.json, which setstest.runnertoMicrosoft.Testing.Platform(global.json:36-37). On .NET SDK 10+, that global selection routes both VSTest-only projects through MTP instead of the_VSTestConsolepath, so the documented commands do not exercise the AppX recipes from this checkout. Add a localglobal.jsonselectingVSTestto each VSTest sample directory, mirroring the local MTP configurations.
# UWP VSTest sample
dotnet test UwpVSTestApp.csproj -p:Platform=x64
# WinUI VSTest sample
dotnet test WinUIVSTestApp.csproj -p:Platform=x64


Windows application samples currently mix generic names, host modes, and packaging behaviors, making it difficult to identify which UWP and WinUI combinations are supported or how to run them locally.
This change organizes the supported scenarios as four explicitly named samples:
UwpVSTestAppWinUIVSTestAppWinUIMtpPackagedAppWinUIMtpUnpackagedAppThe MTP samples are flattened under
samples/public, carry local native-MTPglobal.jsonconfiguration, and support bothdotnet runanddotnet test. The packaged MTP sample is self-contained so it does not require a preinstalled Windows App SDK runtime.The VSTest samples support
dotnet testby using Visual Studio MSBuild for Windows application packaging and then executing the generated AppX recipe through Visual Studio's UWP-aware VSTest console. A public sample matrix documents supported and unsupported host/packaging combinations and the exact local commands.Validation:
dotnet run.dotnet test.dotnet testand their generated AppX recipes.