site/docs/getting-started/v2/migration.md
The xUnit.net team tried to ensure that migration of unit tests from v1 to v2 would be as painless as possible. Most of the migration tasks should be fairly straightforward and mechanical (replacing NuGet packages, doing simple search & replace, etc.).
Binaries for xUnit.net are now distributed exclusively through NuGet. Updating the binaries differs based on whether you originally used CodePlex or NuGet to acquire them. Please choose from one of the two options below.
You will need to manually remove any references to xunit.dll and/or xunit.extensions.dll.
Then, add the new xunit NuGet package. Start by right clicking on the project in Solution Explorer, and then choosing the Manage NuGet Packages... menu item:
{ .border .oversize width=357 }
Browse in the upper left corner. In the search box on the upper right, type xunit. The search should yield results like this:{ .border .oversize width=845 }
Install.Manage NuGet Packages... menu item:{ .border .oversize width=357 }
Installed along the top. If you see xUnit.net: Extensions installed, please click the Uninstall button. (If NuGet offers to uninstall the xunit package for you, you should decline. You're going to upgrade that package in the next step.){ .border .oversize width=982 }
Updates along the top. Locate xUnit.net in the list of packages, and click Update:{ .border .oversize width=981 }
Build your solution. If everything compiles, then you're done!
If it doesn't compile, here are some of the things that may need to upgraded by hand:
Compiler error: 'Xunit.Extensions.PropertyDataAttribute' is obsolete: 'Please replace [PropertyData] with [MemberData]'
If you get this compiler error, change all instances of [PropertyData] to [MemberData]. The new MemberDataAttribute class can read data from static properties (just like PropertyDataAttribute), but now also supports data from static fields and static methods. You can even provide parameter values to static methods!
Compiler error: The type or namespace name 'IUseFixture<T>' could not be found (are you missing a using directive or an assembly reference?)
The interface has been renamed, and its behavior is slightly different now.
Change from IUseFixture to IClassFixture.
Remove the SetFixture method. If you need access to your fixture object, you can accept it as a constructor argument instead.
See Sharing Context between Tests for more information about IClassFixture.