Skip to content

Latest commit

 

History

History
54 lines (32 loc) · 2.63 KB

Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md

File metadata and controls

54 lines (32 loc) · 2.63 KB

Building MSBuild for the .NET Framework

These instructions refer to working with the master branch.

Required Software

Latest Microsoft Visual Studio 2019: You can download the Visual Studio Community edition from https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx.

All command lines should be executed from a Visual Studio developer command prompt.

Getting the code

  1. Clone the repo: git clone https://github.com/dotnet/msbuild
  2. Build on the command line: .\build.cmd
    1. If you encounter errors, see Something's wrong in my build.
  3. Open the solution file in Visual Studio (MSBuild.Dev.slnf).

Running Unit Tests

To run the unit tests from Visual Studio:

  1. Open the MSBuild solution file (MSBuild.Dev.slnf) in Visual Studio.
  2. Open the Test menu -> Windows -> Test Explorer.
  3. Click Run All.

To build MSBuild and run all unit tests from the command line, use .\build.cmd -test.

To mimic our CI job use eng\CIBuild.cmd. Be aware that this command may delete your local NuGet cache.

The CI does two builds. In the second build, it uses the binaries from the first build to build the repository again.

Contributing

Please see Contributing Code for details on contributing changes back to the code. Please read this carefully and engage with us early to ensure work is not wasted.

Walkthroughs

Debugging MSBuild

Using the repository binaries to perform builds

To build projects using the MSBuild binaries from the repository, you first need to do a build which produces a "bootstrap" directory. The "bootstrap" directory mimics a Visual Studio installation by aquiring additional dependencies (Roslyn compilers, NuGet, etc.) from packages or from your local machine (e.g. props/targets from Visual Studio). To produce a bootstrap build, run .\build.cmd /p:CreateBootstrap=true from the root of your enlistment.

Now, just point artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe at a project file.

Patching Visual Studio

Sometimes it's useful to patch your copy of Visual Studio. You can use the Deploy-MSBuild script for that.