Loading...
Loading...
Guide for using MSBuild Server to improve CLI build performance. Only activate in MSBuild/.NET build context. Activate when developers report slow incremental builds from the command line, or when CLI builds are noticeably slower than IDE builds. Covers MSBUILDUSESERVER=1 environment variable for persistent server-based caching. Do not activate for IDE-based builds (Visual Studio already uses a long-lived process).
npx skill4agent add dotnet/skills msbuild-serverdotnet build| Input | Required | Description |
|---|---|---|
| Shell context | No | The shell where the environment variable will be set (bash, PowerShell, or Windows persistent) |
dotnet build# Bash / CI
export MSBUILDUSESERVER=1
# PowerShell
$env:MSBUILDUSESERVER = "1"
# Windows (persistent)
setx MSBUILDUSESERVER 1dotnet builddotnet buildDirectory.Build.propsMSBUILDUSESERVER=1dotnet build-server shutdown| Pitfall | Solution |
|---|---|
| Expecting improvement in Visual Studio | VS already uses long-lived MSBuild nodes; the server adds no benefit |
| Build correctness issues after enabling | Run |
| Server process using unexpected memory | The server persists in background; shut down with |