This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.
$ dotnet add package Microsoft.BuildThis package contains Microsoft.Build.dll, which defines MSBuild's API, including
Microsoft.Build.Evaluation for evaluating MSBuild projects,Microsoft.Build.Construction for creating new MSBuild projects, andMicrosoft.Build.Execution for building MSBuild projects.Developers should reference this package to write applications that create, edit, evaluate, or build MSBuild projects.
To create or edit an MSBuild project, use the Microsoft.Build.Construction.ProjectRootElement class and call the Create or Open method.
To evaluate or build an MSBuild project, use the Microsoft.Build.Evaluation.Project class by creating an instance of it with the appropriate parameters for your project. To retrieve evaluated items, call methods such as properties such as GetItems or GetPropertyValue.