← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

MSTest 4.5 and Microsoft.Testing.Platform 2.5 Enable UI Testing for UWP and WinUI 3 Apps

🔄 Updated 50m ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • MSTest 4.5 and MTP 2.5 enable UI-thread testing.
  • Supports classic/modern UWP, packaged/unpackaged WinUI 3.
  • MSTest.Sdk manages app launch and activation.
  • Uses a full-trust sidecar controller for test execution.

Enhanced UI Testing Capabilities

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.

Simplified Test Execution

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.

Configuration and Considerations

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.

Adopting the New Framework

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 →

The daily brief

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.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Oct 05

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Primary sources

GitHub microsoft/testfx

Reporting from

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.