migrate-xunit-to-xunit-v3

Migrates .NET test projects from xUnit.net v2 packages to xUnit.net v3.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill migrate-xunit-to-xunit-v3-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-xunit-to-xunit-v3
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/migrate-xunit-to-xunit-v3
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill migrate-xunit-to-xunit-v3-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Upgrading .NET test projects from xUnit.net v2 to xUnit.net v3 involves package renames, breaking API changes, and new project configuration requirements that are tedious and error-prone to handle manually. ## Core Features & Use Cases - Package Migration: Maps v2 packages (xunit, xunit.assert, xunit.core) to their xunit.v3.* equivalents and removes obsolete references like xunit.abstractions. - Breaking Change Fixes: Converts async void tests to async Task, updates attributes to Type-based signatures, and fixes custom Fact/Theory and BeforeAfterTestAttribute subclasses. - Test Platform Configuration: Sets OutputType to Exe and configures VSTest or Microsoft.Testing.Platform based on prior setup. - Use Case: A solution with dozens of xUnit v2 test projects needs upgrading; the skill walks through package updates, code fixes, and a final dotnet test verification step by step. ## Quick Start Migrate all xUnit v2 test projects in this solution to xUnit.net v3 and verify the tests still pass.

Frequently Asked Questions about migrate-xunit-to-xunit-v3

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from xUnit v2 to xUnit v3?

Replace xunit packages with xunit.v3 equivalents, set OutputType to Exe in test projects, remove Xunit.Abstractions usings, and fix breaking changes like async void tests. Finish by building and running dotnet test to verify results match.

What are the breaking changes in xUnit.net v3?

Key breaking changes include no async void test support, attributes like CollectionBehavior taking Type instead of strings, custom Fact/Theory attributes requiring caller info parameters, and BeforeAfterTestAttribute methods receiving an IXunitTest parameter.

Does xUnit.net v3 support .NET Framework?

Yes, xUnit.net v3 requires .NET 8 or later, or .NET Framework 4.7.2 or later. Test library projects can also target .NET Standard 2.0. Projects on older frameworks must upgrade their target framework first.

How do I replace Xunit.SkippableFact in xUnit v3?

Remove the Xunit.SkippableFact package entirely, change SkippableFact to Fact and SkippableTheory to Theory, then replace Skip.If with Assert.SkipWhen and Skip.IfNot with Assert.SkipUnless.

When should I not use this xUnit v3 migration approach?

Do not use it for migrating between test frameworks like MSTest or NUnit to xUnit, or for migrating from VSTest to Microsoft.Testing.Platform, which requires the separate migrate-vstest-to-mtp skill.