Infra, Ops & WorkflowSûr100100/100

Use Bootstrap Msbuild (.NET)

Guide for testing bug reproductions against locally-built MSBuild. Use this when you have a repro project and want to verify a fix works before submitting a PR.

ou envoie-le directement à ton agent.

Installer dans ton projet

$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs use-bootstrap-msbuild__dotnet-dotnet__src-msbuild-github-skills-2e372e2099b4
.NET
dotnet/dotnet
Contenu à copier
---
name: use-bootstrap-msbuild
description: Guide for testing bug reproductions against locally-built MSBuild. Use this when you have a repro project and want to verify a fix works before submitting a PR.
metadata:
  origin: .NET
---

# Testing Bug Reproductions with Bootstrap MSBuild

This skill guides you through testing a bug reproduction project against your locally-built MSBuild to verify a fix.

## Overview

After making changes to MSBuild, you need to test them against a repro project. The "bootstrap" is a self-contained MSBuild installation built from your local changes. It includes all dependencies needed to build real projects.

## Step 1: Build MSBuild with Bootstrap

Build MSBuild to create the bootstrap directory:

```powershell
# Windows
.\build.cmd

# Unix/macOS
./build.sh
```

This creates the bootstrap at `artifacts\bin\bootstrap\` with your changes.

Rerun this after making any code change. If run in the default mode, there may be some errors on subsequent builds about locked files (due to MSBuild worker node processes lingering). If so, run `./artifacts/bin/bootstrap/core/dotnet build-server shutdown`.

## Step 2: Run Your Repro Project

### .NET Core / .NET SDK Projects

Use the bootstrap `dotnet` CLI directly (preferred):

```powershell
# Windows
artifacts\bin\bootstrap\core\dotnet.exe build <path-to-repro.csproj>
```

```bash
# Unix/macOS
./artifacts/bin/bootstrap/core/dotnet build <path-to-repro.csproj>
```

All of the usual command line arguments should work, including `-bl` to create binlogs.

### .NET Framework Projects

If the problem is specific to the .NET Framework `MSBuild.exe` that is used in Visual Studio, and you're running on Windows, you can use the bootstrap MSBuild.exe directly:

```powershell
artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe <path-to-repro.csproj>
```

**Note**: The .NET Framework bootstrap output will only be complete when built on Windows using `MSBuild.exe`.

### Changes not reflected

1. Verify bootstrap was rebuilt: check `artifacts\bin\bootstrap\core\sdk\*\MSBuild.dll` timestamp
2. Kill any lingering MSBuild server processes:
   ```powershell
   ./artifacts/bin/bootstrap/core/dotnet build-server shutdown
   # Or use the helper function after sourcing msbuild-build-env.ps1
   killdotnet
   ```

### Repro works with bootstrap but not with installed MSBuild

Your fix is working! The repro uses your local changes while the installed MSBuild has the bug.

## Quick Reference

| Scenario | Command |
|----------|---------|
| Build bootstrap | `.\build.cmd` |
| .NET Core repro | `artifacts\bin\bootstrap\core\dotnet.exe build <project>` |
| .NET Framework repro | `artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe <project>` |

## See Also

- [Bootstrap Documentation](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Bootstrap.md)
- [Building and Debugging Guide](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md)
Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.

Ce que fait Use Bootstrap Msbuild (.NET)

[Bootstrap Documentation](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Bootstrap.md)
[Building and Debugging Guide](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md)

Comment utiliser Use Bootstrap Msbuild (.NET)

1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.

Déclencheurs pour Use Bootstrap Msbuild (.NET)

Dis simplement à ton agent quelque chose comme :

Applique le skill use-bootstrap-msbuild__dotnet-dotnet__src-msbuild-github-skills-2e372e2099b4 à cette tâche
Utilise use-bootstrap-msbuild__dotnet-dotnet__src-msbuild-github-skills-2e372e2099b4 pour améliorer cette implémentation
Passe en revue ce sujet avec use-bootstrap-msbuild__dotnet-dotnet__src-msbuild-github-skills-2e372e2099b4

Skills liés à Use Bootstrap Msbuild (.NET)

Add CLI Command (.NET)
Add or change a dotnet CLI command, subcommand, or option across the relevant CLI projects. USE FOR: adding or changing a dotnet CLI command/subcommand, adding a new Option<T> or Argument<T>, registering a subcommand in the command tree, changing an option's help description or a command's runtime message, wiring a command parser, or updating --help output.
Add Dotnet Aot Command (.NET)
Add, enable, or review a dotnet CLI command or feature in the Native AOT CLI (src/Cli/dotnet-aot) and prove its compatibility. USE FOR: migrating a command or option to AOT, reviewing an AOT migration PR, defining conservative eligibility and managed fallback, changing AotSourceFiles.props or AotDependencies.props, validating AOT/managed parity, NativeAOT-publishing tests, checking binary-size impact, or using the dn harness and separated SDK layout. DO NOT USE FOR: resolving IL trim/AOT analyzer warnings alone (use dotnet-aot-compat), running dotnet.Tests incrementally (use incremental-test), or pure managed CLI work.
Add Net Analyzer (.NET)
Add, port, or change a .NET code analysis rule (CA####) under src/Microsoft.CodeAnalysis.NetAnalyzers. USE FOR: implementing a new CA analyzer and its code fixer, porting a rule or PR from the retired dotnet/roslyn-analyzers repo, allocating a diagnostic ID from DiagnosticCategoryAndIdRanges.txt, choosing RuleLevel/severity/category, wiring resx + xlf strings, recording the rule in AnalyzerReleases.Unshipped.md, regenerating the analyzer documentation/sarif files, and writing MSTest analyzer/code-fix tests with the VerifyCS/VerifyVB harness. DO NOT USE FOR: NETSDK#### MSBuild diagnostics (src/Tasks), CS####/BC#### compiler diagnostics or IDE#### analyzers (dotnet/roslyn), or CONTAINER#### diagnostics (src/Containers).