Table of Contents

Visual Studio adapter 2.5.0 2023 July 6

Today, we're shipping three new releases:

  • xUnit.net Core Framework v2 2.5.0 (release notes)
  • xUnit.net Analyzers 1.2.0 (release notes)
  • xUnit.net Visual Studio adapter 2.5.0

It's been 14 months since the release of 2.4.5.

Important

This version has updated the minimum framework support to .NET Framework 4.6.2+ and .NET 6.0+, and has removed support for UWP. Users who require support for UWP or older version of .NET/.NET Core should continue to use an older build of this adapter.

As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉 And we would especially like to thank Claire Novotny who had been maintaining the Visual Studio adapter for several years.

Note

We have moved away from Twitter for our occasional updates, and now make those available on our Mastodon account (@xunit@dotnet.social) and Bluesky account (@xunit.net).

Release Notes

These release notes are a comprehensive list of changes from 2.4.5 to 2.5.0.

Features and Fixes

  • Added assembly-wide ExcludeFromCodeCoverageAttribute to all the xUnit.net assemblies. This should resolve issues with dotnet test ---collect "Code Coverage" (the new cross-platform code coverage system) incorrectly showing coverage for the adapter. xunit/xunit#2682

  • JSON configuration files can now use the new failSkips configuration element to convert skipped tests into failed tests.

  • Added support for stopOnFail configuration file element.

  • Moved reporting of skip messages to the Messages output in Test Explorer. This allows users to filter by skip reasons in the Test Explorer UI (since Messages is a searchable field). Previously, these had been reported in the Test Explorer UI as Output. xunit/visualstudio.xunit#110

  • BUG: The DisableAppDomain run setting from VSTest was supported for execution but ignored for discovery. This has been fixed to be honored now for both, which should dramatically improve discovery performance for any .NET Framework projects when VSTest has indicated that app domains are not required. In simple testing with 10k tests on a machine with an AMD 5900X CPU and 64GB of RAM, this cut discovery time roughly in half, bringing it in line with the discovery time for .NET Core projects (which have never supported app domains). xunit/visualstudio.xunit#331

  • BUG: Fixed a performance issue with reporter discovery related to scanning every single DLL in your output folder looking for types which implement reporters. Now we only scan libraries named *reporters*.dll which may break any custom reporters you are using from first or third party assemblies without an appropriate name. xunit/visualstudio.xunit#317

  • BUG: Fixed an issue where data-driven tests with only a params array could not be run with an empty [InlineData] declaration. For example, this worked:

    [Theory]
    [InlineData(new int[] { })]
    public void MyTest(params int[] values)
    

    But this would not:

    [Theory]
    [InlineData]
    public void MyTest(params int[] values)
    

    xunit/visualstudio.xunit#371