Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advantages of using MSBuild or NAnt versus running DevEnv.exe from command-line

Tags:

Can anyone explain what advantages there are to using a tool like MSBuild (or NAnt) to build a collection of projects versus running DevEnv.exe from the command-line?

A colleague I had worked with in the past had explained that (at least with older versions of Visual Studio) using DevEnv.exe was much slower than the other techniques, but I haven't read any evidence of that or if that is now a moot point now that starting with 2005, Visual Studio uses MSBuild under the hood.

I know one advantage of using MSBuild allows you to build your projects without requiring Visual Studio to be installed on the build machines, but I wasn't sure if there were others.

like image 796
afournier Avatar asked Sep 26 '08 19:09

afournier


People also ask

What is the difference between MSBuild and Devenv?

Devenv uses MSBuild to build projects, but MSBuild does not build Visual C++ Projects. If MSBuild comes across a solution that includes Visual C++ projects, it will call VCBuild. If the projects are using C++, then MSBuild is not called.

What is MSBuild and do I need it?

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.

How do I use MSBuild EXE?

Use MSBuild at a command prompt To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.


2 Answers

One reason is because there's much more to building a product than just compiling it. Tasks such as creating installs, updating version numbers, creating escrows, distributing the final packages, etc. can be much easier because of what these tools (and their extensions) provide.

While you could do all this with regular scripts, using NAnt or MSBuild give you a solid framework for doing all this. There's a lot of community support for both, including additional tasks that can be downloaded (such as the MSBuild Community Tasks Project). Plus, there's support for them in numerous third party and open source products.

If you're just interested in compiling (and not the entire build process), you may find one time saving benefit of MSBuild is the support for building with multiple processors.

like image 111
Josh Sklare Avatar answered Oct 09 '22 02:10

Josh Sklare


The obvious answer from my team is that not everbody has visual studio installed, in particular we do not install Visual Studio onto our build/CI servers.

like image 32
Jack Ukleja Avatar answered Oct 09 '22 01:10

Jack Ukleja