MSTest 4.5 and Microsoft.Testing.Platform (MTP) 2.5 now provide a UI-thread testing pattern for Universal Windows Platform (UWP) and WinUI 3 applications. This allows test setup, asynchronous test code, and cleanup to execute with direct access to the UI thread, which is necessary for reliable UI testing.
The supported application models include classic and modern UWP, as well as packaged or unpackaged WinUI 3 apps, and WinUI hosts utilizing AppContainer.
MSTest.Sdk automatically determines the appropriate launch path for each app model. It directly starts unpackaged applications and uses Microsoft.Testing.Extensions.PackagedApp to register and activate packaged apps via their Application User Model ID (AUMID). For AppContainer hosts, it also grants necessary access to the controller and report pipes.
Instead of the initial test tool, MSTest.Sdk launches a full-trust sidecar controller. This controller manages test arguments, cancellation requests, reports, retries, and the final exit code, then initiates the app hosting the tests. This approach bypasses the use of Microsoft.NET.Test.Sdk, vstest.console, UwpTestHostRuntimeProvider, or Visual Studio deployment runtime.
To enable packaged activation for unsigned build outputs, Developer Mode or a similar sideloading policy is required. AppContainer tests should be run non-elevated, and the policy on the Continuous Integration (CI) agent must be confirmed.
For WinUI applications, starting unpackaged is recommended unless specific behaviors like package identity, packaged activation contracts, or an exact match with installed app behavior are under test. UWP applications are inherently packaged and sandboxed.
Developers can select MSTest.Sdk and MTP for UWP and WinUI 3 apps by configuring global.json at the solution or repository root. This involves pinning MSTest.Sdk 4.5 and selecting Microsoft.Testing.Platform for the native .NET 10 dotnet test experience. Without this configuration, .NET 10 defaults to VSTest.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
MSTest 4.5 and Microsoft.Testing.Platform 2.5 now support UI-thread testing for UWP and WinUI 3 applications, allowing test code to run with UI-thread access. This update simplifies testing for various UWP and WinUI 3 app models by handling app launch paths and enabling a sidecar controller for test execution.