xUnit.net v3: what the .NET test runner actually does and where it stops
xUnit.net is a free, open source, community-focused unit testing tool for .NET.
At a glance
- What is it?
- xUnit.net is the community-maintained unit testing tool for C#, F# and Visual Basic. Version 3 requires .NET 8.0 or later, ships through NuGet, and runs under Microsoft Testing Platform or VSTest.
- Who is it for?
- Adopt xUnit.net v3 if your test projects already target .NET 8.0 or later and you want a runner that speaks Microsoft Testing Platform or VSTest without extra glue. Stay on xUnit.net v2 if you still build against older target frameworks, because v3 raises the floor to .NET 8.0 and .NET Framework 4.7.2.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly C#, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The problem xUnit.net solves for .NET teams
A .NET solution accumulates behaviour that nobody wants to verify by hand: parsers, pricing rules, state machines. xUnit.net exists to turn those checks into code that a build server can run on every commit. It is aimed at developers writing C#, F#, or Visual Basic, and the README lists the environments it supports: the .NET SDK command line, Visual Studio, Visual Studio Code, JetBrains Rider, NCrunch, and anything compatible with Microsoft Testing Platform or VSTest. That last clause matters more than the editor list. The project does not try to own your IDE. It plugs into a runner interface that other tools already implement, so the same test assembly works from a terminal, from a CI job, and from an editor's test explorer.
The project sits inside the .NET Foundation and is governed by a Project Lead, according to the README. That structure is worth noting for teams that need to justify a dependency: there is a named governance page at xunit.net/governance, and the licence is Apache 2, which the README describes as OSI approved. Note the mismatch between the repository metadata, which reports the licence as NOASSERTION, and the README, which states Apache 2. The README is the more specific source, but a legal review should confirm against the LICENSE file at the repository root.
How the xUnit.net packages fit together
The README's build table names four packages, and they do different jobs. xunit.v3 is the current test framework for v3. xunit is the v2 line, and the CI badge for it points at the v2 branch, so the two versions are maintained on separate branches rather than one. xunit.analyzers carries Roslyn analyzers, which is where compile-time warnings about test code come from. xunit.runner.visualstudio is the adapter that lets Visual Studio and other VSTest-based hosts discover and run the tests.
That split explains a common confusion. Installing the framework package alone gives you attributes and assertions, but no runner integration. The runner package is what makes the tests appear in an IDE or in a dotnet test invocation under VSTest. The README also points at a separate repository, assert.xunit, for the assertion library, and warns that contributing there is more complex because the code is spread across two GitHub repositories. So the assertion surface and the runner are not one artefact.
Version numbering is another place where the repository is not self-explanatory. The releases are tagged v3-4.0.0 and v3-4.0.1, which reads as a 4.x version inside the v3 product line. Anyone scanning release tags for a "v4" will not find one in the release list; the v3 prefix is the product line, not the major version of the package.
Installing xUnit.net and running a first test
The README does not inline installation commands. It points to the .NET SDK for the toolchain and to the getting-started page at xunit.net/docs/getting-started/v3/getting-started for the walkthrough. The package identifiers themselves come from the build table, so the package names below are the ones the README uses.
The README's build table lists the packages under these identifiers. For the v3 line the framework package is xunit.v3, and the adapter that lets Visual Studio and other VSTest-based hosts discover and run tests is xunit.runner.visualstudio. The v2 line is published as xunit, and the analyzer package is xunit.analyzers. Installing the framework package alone gives you attributes and assertions; the runner package is what makes discovery work in a VSTest-based host. The README does not print the exact add-package invocation, so follow the getting-started page for the current syntax.
Once the packages are referenced, the README points to the getting-started page for the first test and for how to run it. The README also names the supported hosts: the .NET SDK command line, Visual Studio, Visual Studio Code, JetBrains Rider, NCrunch, and anything compatible with Microsoft Testing Platform or VSTest. If you prefer Microsoft Testing Platform over VSTest, the README lists it as a supported host. The project documents CI builds separately at xunit.net/docs/using-ci-builds, and those come from feedz.io rather than nuget.org, with a free login required according to the README.
Where xUnit.net v3 is the wrong choice
The clearest boundary is the target framework. The README states that xUnit.net v3 supports .NET 8.0 or later and .NET Framework 4.7.2 or later. A library that still ships for .NET Framework 4.6.1, or a test project pinned to an older .NET version, cannot move to v3 without retargeting first. That is not a configuration flag; it is a platform floor. Teams in that position should look at the xunit package, which the README presents as the v2 line, and treat v3 adoption as a separate migration project.
A second boundary is the assertion library's split across repositories. The README explicitly says the assertion library lives in assert.xunit and that contributing there is more complex because the code is spread across two repositories. If your team's plan involves patching assertion behaviour and shipping an internal fork, that split adds coordination cost that a single-repository framework would not have.
The documentation trail is also thin in one specific place. The README sends readers to xunit.net for project documentation rather than describing behaviour itself, and it does not document rollback or downgrade steps for the packages. Anyone who needs a documented reversal path will not find it in the README.
xUnit.net compared with NUnit and MSTest
The related searches show that people compare xUnit.net against NUnit and MSTest, and the repository data supports a narrow, factual comparison rather than a verdict. All three are .NET test frameworks; the difference visible here is in the runner contract. The README states that xUnit.net works with any development environment compatible with Microsoft Testing Platform or VSTest. That is a deliberate bet on host compatibility rather than a bespoke runner protocol, and it is why the same assembly can surface in Visual Studio, VS Code, Rider, and NCrunch without per-editor work from the framework authors.
NUnit and MSTest are not described anywhere in the README, so any claim about their internals would be invention. What can be said is structural: xUnit.net separates the framework package, the analyzer package, and the VSTest adapter into distinct NuGet packages, and it maintains v2 and v3 on separate branches with separate CI badges. A team choosing between frameworks should compare that packaging model against whatever the alternatives publish, using each project's own documentation as the source.
Maintenance, versioning and licence cost
The repository is not archived, and the last push was on 2026-09-22. The most recent release listed is v3-4.0.1 on 2026-09-12, preceded by v3-4.0.0 on 2026-08-15 and a pre-release, v3-4.0.0-pre.154, on 2026-07-17. That cadence suggests a project that ships patch releases after a major line, but the README does not state a support window for any version, so do not assume one.
The upgrade cost that is visible comes from the versioning scheme, not from a migration guide. Release tags carry a v3- prefix while the package version is 4.x, so a team tracking releases by tag needs to read the tag and the package version as two separate numbers. The README also distinguishes stable NuGet packages from CI builds on feedz.io, which require a free login. Pulling CI builds into a shared build pipeline therefore adds an account dependency that stable packages do not have.
On licensing, the README states Apache 2 and calls it OSI approved, while the repository metadata reports NOASSERTION. Apache 2 permits commercial use and modification under its own terms, but the discrepancy between the two sources is the thing to resolve before relying on either. This is a factual observation about the repository, not legal advice.
Editorial conclusion
Adopt xUnit.net v3 if your test projects already target .NET 8.0 or later and you want a runner that speaks Microsoft Testing Platform or VSTest without extra glue. Stay on xUnit.net v2 if you still build against older target frameworks, because v3 raises the floor to .NET 8.0 and .NET Framework 4.7.2. Before migrating, check which of the four packages in the README table your project actually references, and confirm that your CI host accepts the runner you pick.
Frequently asked questions
What is xUnit.net used for?
It is a unit testing tool for C#, F#, and Visual Basic, according to the README. It runs through the .NET SDK command line, Visual Studio, Visual Studio Code, JetBrains Rider, NCrunch, or any environment compatible with Microsoft Testing Platform or VSTest.
Is xUnit.net better than NUnit?
The README does not describe NUnit, so no comparison can be made from it. What the README does state is that xUnit.net targets any environment compatible with Microsoft Testing Platform or VSTest, and that it ships as separate framework, analyzer, and VSTest adapter packages.
Is xUnit.net deprecated?
No. The repository is not archived, the last push was on 2026-09-22, and the most recent release listed is v3-4.0.1 on 2026-09-12. The README also states that the project is governed by a Project Lead under the .NET Foundation.
How do I install xUnit.net in a .NET project?
The README points to the .NET SDK for the toolchain and to the getting-started page at xunit.net/docs/getting-started/v3/getting-started for the walkthrough. The package identifiers named in the README build table are xunit.v3 for the v3 framework and xunit.runner.visualstudio for the VSTest adapter.
What does xUnit.net v3 require in terms of .NET version?
The README states that xUnit.net v3 supports .NET 8.0 or later and .NET Framework 4.7.2 or later. Projects targeting older frameworks cannot move to v3 without retargeting first.
How do I add xUnit.net to an existing project?
The README directs readers to the .NET SDK and the getting-started page for the v3 walkthrough rather than giving inline steps. The build table names xunit.v3 and xunit.runner.visualstudio as the packages, and the README notes the assertion library lives in a separate repository, assert.xunit.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/xunit-xunit)