Skip to content

WinUI3 + MSTest #708

@azchohfi

Description

@azchohfi

Description

Today, UWP applications are based on .Net Native.
Soon, UWP applications will also be able to use .Net Core 5 (dotnet/runtime#35318).
This is a great evolution of the platform, but at the same time, requires a few changes to existing libraries, such as MSTest.

If a WinUI3 project references MSTest, instead of using the uap10.0 assemblies (which now should be deprecated), it will use the netstandard1.0 ones, which does not encapsulate the Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer namespace (which contains the very useful UITestMethodAttribute), and creates a Main method, which conflicts with WinUI3's.
Also, the current implementation of UITestMethodAttribute uses CoreDispatcher, not the DispatcherQueue, which is preferred, as CoreDispatcher will not work on Win32.

Steps to reproduce

Use WinUI3 and MSTest on the same sdk style .Net Core 5 project

Expected behavior

MSTest works with WinUI3 (both inside and outside of a container - UWA or Win32), providing a UITestMethodAttribute and properly running tests both thru appxrecipe or a simple .Net Core 5 exe.

Actual behavior

Project does not build, and impossible to run the tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions