Putting this all together, we also need to add a line to our dotnet publish command, to use the MSBuild command "-p:Version", and then the variable name. Note that if use the version argument on dotnet. MSBuild is a build tool that helps automate the process of creating a software product, including compiling the source code, packaging, testing, deployment and creating documentations. With MSBuild, it is possible to build Visual Studio projects and solutions without the Visual Studio IDE installed. MSBuild is free and open-source. .