- PowerShell 6.0 or higher (see this question to check your PowerShell version)
- .NET 10 SDK
- .NET 9 Runtime (Or SDK) (Required only if testing)
- .NET 8 Runtime (Or SDK) (Required only if testing)
- .NET 6 Runtime (Or SDK) (Required only if testing)
NOTE: If the project is open in Visual Studio, its background restore may interfere with these commands. It is recommended to close all instances of Visual Studio that have this project open before executing.
To build the source, clone or download and unzip the repository. From the repository or distribution root, execute the build command from a command prompt and include the desired options from the build options table below:
> build [options]./build [options]NOTE: The
buildfile will need to be given permission to run using the commandchmod u+x buildbefore the first execution.
The following options are case-insensitive. Each option has both a short form indicated by a single - and a long form indicated by --. The options that require a value must be followed by a space and then the value, similar to running the dotnet CLI.
| Short | Long | Description | Example |
|---|---|---|---|
| ‑config | ‑‑configuration | The build configuration ("Release" or "Debug"). | build ‑‑configuration Debug |
| ‑t | ‑‑test | Runs the tests after building. This option does not require a value. | build ‑t |
For example the following command creates a Release build with NuGet package with a version generated using the nbgv tool and will also run the tests for every target framework.
> build --configuration Release --test./build --configuration Release --testNuGet packages are output by the build to the /_artifacts/NuGetPackages/ directory. Test results (if applicable) are output to the /_artifacts/TestResults/ directory.
You can setup Visual Studio to read the NuGet packages like any NuGet feed by following these steps:
- In Visual Studio, right-click the solution in Solution Explorer, and choose "Manage NuGet Packages for Solution"
- Click the gear icon next to the Package sources dropdown.
- Click the
+icon (for add) - Give the source a name such as
spatial4n Local Packages - Click the
...button next to the Source field, and choose the/src/_artifacts/NuGetPackagesfolder on your local system. - Click Ok
Then all you need to do is choose the spatial4n Local Packages feed from the dropdown (in the NuGet Package Manager) and you can search for, install, and update the NuGet packages just as you can with any Internet-based feed.
- Visual Studio 2022 or higher
- .NET 10.0 SDK
- .NET 9 Runtime (Or SDK) (Required only if testing)
- .NET 8 Runtime (Or SDK) (Required only if testing)
- .NET 6 Runtime (Or SDK) (Required only if testing)
NOTE: Visual Studio 2022 is only supported for building and testing .NET Core and .NET Standard 2.1 due to false errors caused by lack of LSP language support for C# 14.0. It is recommended to use Visual Studio 2026, which fully supports our build. If using Visual Studio 2022, we recommend running
dotnet buildon the command line prior to submitting PRs to ensure builds succeed on .NET Framework and .NET Standard 2.0.
- Open
J2N.slnin Visual Studio. - Build a project or the entire solution, and wait for Visual Studio to discover the tests.
- Run or debug the tests in Test Explorer, optionally using the desired filters.
TIP: When running tests in Visual Studio, set the default processor architecture to either 32 or 64 bit depending on your preference.