-
Couldn't load subscription status.
- Fork 10.5k
Building from source
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.
There are typically new builds of tools and packages available every day. To automatically update to the latest versions, run the following:
build.cmd -Update /t:Restore
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.
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:
- Prepare
- Restore
- Compile
- Package
- Test
- Verify
- 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
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. |
| IncrementalVersion |
true or false. Default = false. When true, BuildNumber will be automatically set based on the current timestamp. |