Getting the source and building xUnit.net

Get a Git Client

Download a Git client, such as:

Get the xUnit.net source code

Using your Git client of choice, do a clone of https://github.com/xunit/xunit.git. When cloning, ensure the client automatically checks out Git submodules (from the command line, add the --recurse-submodules switch).

If you want help understanding and using Git, please see the Pro Git e-book.

Open Visual Studio solution

The core project (https://github.com/xunit/xunit) requires you to install Visual Studio 2017 with the following workloads enabled:

And the following individual components:

You should be able to immediately build the solution, as all external dependencies are automatically retrieved with NuGet Package Restore. If you want to run the unit tests from within Visual Studio, we strongly recommend you use TestDriven.net.

Build and run the tests from the command

For the purposes of demonstration, we will assume that you checked out the source code to C:\xUnit.

If you have problems building the assertion library, you may have forgotten to update the submodules. From the command line, run git submodule update --init.

Copyright © 2017 .NET Foundation. Contributions welcomed at https://github.com/xunit/xunit.github.io.