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
If you want help understanding and using Git, please see the Pro Git e-book.
Install .NET Core SDK and Runtimes
Visit the .NET Downloads page to install:
- .NET SDK 2.1.302 or later
Required Visual Studio 2017 options
The core project (https://github.com/xunit/xunit) requires you to install
Visual Studio 2017 (with the latest service pack) with the following
- Windows > .NET desktop development
- Windows > Universal Windows Platform development
- Web & Cloud > ASP.NET and web development
- Other Toolsets > .NET Core cross-platform development
And the following individual components:
- .NET > .NET Core Runtime
- .NET > Every .NET Framework targeting pack and SDK (yes, all of them!)
- Development activities > F# desktop language support
- SDKs, libraries, and frameworks > Windows 10 SDK (10.0.10240.0)
- SDKs, libraries, and frameworks > Windows 10 SDK (10.0.16299.0)
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
Build and run the tests from the command
For the purposes of demonstration, we will assume that you checked out the source code to
- Open a Developer Command Prompt
- Change to the directory with the source code:
- Type the following command to build and run the tests:
- Ensure there are no errors at the end of the build process.
If you have problems building the assertion library, you may have forgotten to update the submodules. From the command line,
git submodule update --init.