msbuild-server

Configures MSBuild Server to cache build evaluations across CLI dotnet build runs.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill msbuild-server-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: msbuild-server
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-msbuild/skills/msbuild-server
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill msbuild-server-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Command-line builds with dotnet build start a fresh MSBuild process each time, losing the evaluation caching that Visual Studio gets from its long-lived process, making incremental CLI builds slower than IDE builds. ## Core Features & Use Cases - Persistent Build Caching: Sets the MSBUILDUSESERVER=1 environment variable so MSBuild Server caches evaluation results across sequential CLI builds. - Shell-Specific Setup: Provides commands for bash, PowerShell, and persistent Windows environment configuration. - Validation Workflow: Compares cold and warm build times and uses dotnet build-server shutdown to verify clean server restarts. - Use Case: A CI agent runs many sequential builds of a large multi-project repository; enabling the server makes each warm build noticeably faster than the first cold build. ## Quick Start Enable MSBuild Server for my command-line builds and verify that the second dotnet build runs faster than the first.

Frequently Asked Questions about msbuild-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I speed up dotnet build from the command line?

Set the MSBUILDUSESERVER=1 environment variable to enable MSBuild Server, which caches evaluation results across builds. The second sequential build of the same project should run noticeably faster than the first cold build.

Why is dotnet build slower than Visual Studio builds?

Visual Studio uses a long-lived MSBuild process that caches project evaluations, while each CLI build starts fresh. Enabling MSBuild Server with MSBUILDUSESERVER=1 gives CLI builds the same caching advantage.

Does MSBuild Server help with Visual Studio builds?

No, Visual Studio already uses a long-lived MSBuild process with its own caching, so the server adds no benefit for IDE-based builds. It only improves command-line builds via dotnet build.

How do I reset or stop the MSBuild Server?

Run dotnet build-server shutdown to stop the background server process. Use this when you suspect build correctness issues or want to free the memory held by the persistent server.

When should I not use MSBuild Server?

Avoid it for one-off builds where cold-start overhead is acceptable, for IDE-based builds, and when investigating build correctness issues. Disable the server to isolate whether it contributes to a build problem.