Skip to content

Building from source

Nate McMaster edited this page Feb 7, 2018 · 6 revisions

Building in Visual Studio / Code

Before opening our .sln files in Visual Studio or VS Code, executing the following on command-line:

build.cmd /t:Restore

This will download required tools.

PATH

For VS Code and Visual Studio to work correctly, you must place the following location in your PATH.

Windows: %USERPROFILE%\.dotnet\x64
Linux/macOS: $HOME/.dotnet

This must come before any other installation of dotnet. In Windows, we recommend removing C:\Program Files\dotnet from PATH in system variables and adding %USERPROFILE%\.dotnet\x64 to PATH in user variables.

Building on command-line

Most repositories in https://github.com/aspnet/ have a build.cmd or build.sh script in the repository root. Executing this script will begin building the default lifecycle. The steps of the default lifecycle, in order, are:

  1. Prepare
  2. Restore
  3. Compile
  4. Package
  5. Test
  6. Verify
  7. Build**

** This is the default build target.

To run only a portion of the lifecycle, add arguments in the form /target:$name or /t:$name for short. For example:

./build.sh /t:Compile

Build properties

Additional properties can be added as an argument in the form /property:$name=$value, or /p:$name=$value for short. For example:

build.cmd /p:Configuration=Release

Common properties include:

Property Description
BuildNumber (string). A specific build number, typically from a CI counter
Configuration Debug or Release. Default = Debug.
SkipTests true or false. When true, builds without running tests.
NoBuild true or false. Runs tests without rebuilding.