This article applies to: ✔️ .NET Core 1.x SDK ✔️ .NET Core 2.x SDK
dotnet msbuild - Builds a project and all of its dependencies.
dotnet msbuild <msbuild_arguments> [-h]
dotnet msbuild command allows access to a fully functional MSBuild.
The command has the exact same capabilities as the existing MSBuild command-line client for SDK-style projects only. The options are all the same. For more information about the available options, see the MSBuild command-line reference.
The dotnet build command is equivalent to
dotnet msbuild -restore -target:Build. dotnet build is more commonly used for building projects, but because it always runs the build target, you can use
dotnet msbuild when you don't want to build the project. For example, if you have a specific target you want to run without building the project, use
dotnet msbuild and specify the target.
Build a project and its dependencies:
Build a project and its dependencies using Release configuration:
dotnet msbuild -property:Configuration=Release
Run the publish target and publish for the
dotnet msbuild -target:Publish -property:RuntimeIdentifiers=osx.10.11-x64
See the whole project with all targets included by the SDK:
dotnet msbuild -preprocess