The primary build system for xUnit.net is done via command line. You can also build from within Visual Studio 2022 (or later) as the only supported IDE environment (others like Resharper should work, though).
You will need the following software installed:
- .NET Framework 4.7.2 or later (part of the Windows OS)
- .NET SDK 9.0
- .NET 6.0 Runtime
- git
- PowerShell (or PowerShell Core)
Ensure that you have configured PowerShell to be able to run local unsigned scripts (either by running
Set-ExecutionPolicy RemoteSigned
from within PowerShell, or by launching PowerShell with the
-ExecutionPolicy RemoteSigned
command line switch).
-
Open PowerShell (or PowerShell Core).
-
From the root folder of the source repo, this command will build the code & run all tests:
./build
To build a specific target (or multiple targets):
./build [target [target...]]
The common targets (case-insensitive) include:
Restore
: Perform package restoreBuild
: Build the sourceTest
: Run unit testsTestCore
: Run unit tests (.NET Core)TestFx
: Run unit tests (.NET Framework)
You can get a list of options:
./build --help