Table of Contents

Visual Studio adapter 3.0.0 2024 December 16

Today, we're shipping three new releases:

  • xUnit.net Core Framework v3 1.0.0 (release notes)
  • xUnit.net Analyzers 1.18.0 (release notes)
  • xUnit.net Visual Studio adapter 3.0.0

It's been 5 months since the release of 2.8.2.

As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉

Release Notes

These release notes are a comprehensive list of changes from 2.8.2 to 3.0.0.

Features and Fixes

  • This is the first official release of the Visual Studio adapter that's capable of running v3 test projects.

  • We have started reporting StartTime and EndTime to VSTest, which should resolve rare cases where dotnet test could report incorrect total time for a test assembly. xunit/visualstudio.xunit#401 microsoft/vstest#4894

  • We have added four new RunSettings options: Culture, Explicit, FailWarns, and Seed.

  • We have added a new custom property to the VSTest Test Case object: XunitSkipReason. Note that this value is only filled in for tests which are unconditionally skipped; that is, if the test sets either SkipWhen or SkipUnless (indicating that it's conditionally skipped), then this value will not be present. xunit/visualstudio.xunit#422

  • BUG: We have fixed an issue where xunit.runner.visualstudio would not run tests on Linux or macOS when using Mono (for .NET Framework projects). This manifested as a warning message reading: No test is available in /path/to/tests.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again. xunit/visualstudio.xunit#411

  • BUG: Fixed an issue where it was not possible to run v3 tests marked as Explicit. The logic now is:

    • If the whole project is run, do not run explicit tests.
    • If multiple tests are selected to run, only run explicit tests if every selected test is explicit.
    • If a single test is selected to run, always run it.

    This logic is necessary due to the fact that Test Explorer does not have a concept of 'explicit' tests. xunit/visualstudio.xunit#412

  • BUG: In some situations, it was possible that xunit.runner.json was not being loaded (and default configuration values were used instead).

  • BUG: Fixed an issue launching the debugger in Visual Studio Code. xunit/xunit#3019 xunit/visualstudio.xunit#415

  • BUG: Fixed an issue where issuing a filter that matched no tests caused a catastrophic failure rather than simply running no tests. xunit/visualstudio.xunit#417

  • BUG: We have fixed an issue where source information (file & line number) for a unit test was not reported when the test is inherited from a class in another project. xunit/xunit#3023

  • BUG: We have fixed an issue where command-line test runs could not filter based on traits coming from ITheoryDataRow due to not pre-enumerating theory data. xunit/visualstudio.xunit#426

  • For developers contributing to xunit.runner.visualstudio, you can now build and run tests for the project on Linux and macOS.