Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth learning to use MSBuild?

Tags:

I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio.

I am thinking in terms of nightly builds, etc., but then couldn't I use a scheduled event which uses the command-line build option built into VS? Are there superior tools out there?

like image 988
ljs Avatar asked Sep 06 '08 22:09

ljs


People also ask

What is MSBuild and do I need it?

The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software. Visual Studio uses MSBuild, but MSBuild doesn't depend on Visual Studio.

Can I use MSBuild without Visual Studio?

To install MSBuild on a system that doesn't have Visual Studio, go to Build Tools for Visual Studio 2019, or install the . NET SDK. If you have Visual Studio, then you already have MSBuild installed. With Visual Studio 2022, it's installed under the Visual Studio installation folder.

What is the difference between MSBuild and Visual Studio build?

Visual Studio determines the build order and calls into MSBuild separately (as needed), all completely under Visual Studio's control. Another difference arises when MSBuild is invoked with a solution file, MSBuild parses the solution file, creates a standard XML input file, evaluates it, and executes it as a project.

Is MSBuild part of .NET framework?

Microsoft Build Engine, better known as MSBuild, is a free and open-source build tool set for managed code as well as native C++ code and was part of . NET Framework.


2 Answers

@kronoz
I would say YES.
The neat thing about MSBuild is that if you modify your csproj files to include custom build steps then those steps will happen from within VS or from MSBuild. Also if you ever have a build server you will not need to install full VS, only the SDK to build your projects.

like image 118
Andrew Burns Avatar answered Oct 04 '22 14:10

Andrew Burns


MSBuild is absolutely worth the time to learn. After the initial learning curve (which might be very steep actually) it becomes fairly easy to do the most common build automation steps.

  • building assemblies in RELEASE mode
  • signing assemblies with strong name
  • running unit tests
  • modifying xml files / Web.config-s on the fly
  • modifying the version number of the assemblies
  • validating FxCop / StyleCop etc...
  • automated deployment - create SQL databases, IIS websites, windows services etc...
like image 32
Jivko Petiov Avatar answered Oct 04 '22 16:10

Jivko Petiov