Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

UWP test runners do not work on Visual Studio 2022 #171

Open
idg10 opened this issue Feb 24, 2023 · 2 comments
Open

UWP test runners do not work on Visual Studio 2022 #171

idg10 opened this issue Feb 24, 2023 · 2 comments

Comments

@idg10
Copy link

idg10 commented Feb 24, 2023

If you follow the xUnit instructions for creating a brand new UWP project from scratch and adding a test the resulting tests will not run. The Visual Studio Explorer shows them, but if you try to run all tests, they won't run.

You can see an example of this in a real project:

  1. clone the https://github.com/dotnet/reactive repo (at commit 85f1eb7 at the time of writing this)
  2. open the System.Reactive.sln solution in Rx.NET/Source in Visual Studio 2022.
  3. Build the solution
  4. Open Test Explorer, and note that the UWP tests are visible
  5. Run all tests, and note that while the non-UWP tests all eventually get green ticks, the UWP tests end up with a blue triangle indicating that they did not run

These tests all run in Visual Studio 2019. Visual Studio 2022 has changed something—either in the way it expects test adapters to work, or in the way it hosts UWP applications.

Note that MSTest continues to work on UWP applications in Visual Studio 2022. So it is certainly possible to make a test adapter that works for UWP on Visual Studio 2022.

@idg10
Copy link
Author

idg10 commented May 18, 2023

Since the only changes to this repo in the last 4 years have been dependency updates (almost entirely driven by dependabot) or tweaks to the .NET Foundation logo and some xUnit hyperlinks in the docs, I came to the conclusion that the xUnit project has no interest in maintaining support for UWP.

Since the Rx project is committed to continuing to support UWP, this means either we can't use xUnit, or we need to try to drag xUnit's UWP support forward by 4 years to get it working again.

We've moved Rx back to MSTest because it was by far the easier option. I believe Rx originally used MSTest—it never did anything with xUnit that you couldn't do equally well with any other test framework, so this was relatively painless. (Conversely, tackling anything UWP-related is generally a total nightmare because there's no official support for UWP in the modern .NET SDK project system. So getting this working again for xUnit would have been a non-trivial undertaking.)

Since Rx no longer depends on MSTest, I no longer care about this issue. I'm leaving it open on the off chance that this didn't in fact reduce the sum total of people who do care to 0.

@bradwilson
Copy link
Member

@idg10 You are correct. @clairernovotny owned this project but has since stepped aside. Since UWP has been deprecated in favor of WinUI, I recently (maybe a week or two ago) let her know that I'd be retiring this project and archiving the repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants