Take the 2-minute tour ×

I'm a Unix CM geek, and know little about Microsoft .NET development. We now have a VisualStudio .NET project that we need to build. I want to use Jenkins to do the build. I had setup a previous VS project on another build server using Jenkins with Jenkins calling `msbuild.exe (version 3.5).

Currently, they build this project on their local desktops (oh, why do MS geeks think this is acceptable?). They do three builds: One in VS 2003, one in VS 2008, and one in VS 2010.

My thinking is that they simply don't understand what they're doing, or using those different versions of Visual Studio to build to different .NET versions. My questions:

  • Do I need VisualStudio installed in order to get msbuild.exe? If not, where can I find it? The other build server I setup had VisualStudio .NET installed although it isn't used on our build box.
  • What version of msbuild.exe is for which version of the .NET framework and which version of VisualStudio? The other build box is using 3.5 which seems to work quite nicely for them.
  • Is there really a need to build all those different versions of the app?
share|improve this question

3 Answers 3

up vote 1 down vote accepted

You can build both VS 2008 and VS 2010 versions with the .Net 4.0 SDK by setting the TargetFrameworkVersion appropriately. I really do hope you meant that the oldest version used is VS 2005 (.Net 2.0), which also can be targeted using this method - if you really are using VS 2003 (targeting .Net 1.1) - you're out of luck, msbuild did not exist back then. But the dinosaurs did!

share|improve this answer
@Reed, yes the .NET SDK does give you MSBuild (and compilers): C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe and C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe. –  Chris O May 13 '11 at 17:07
Good to know ;) I knew it gave the compilers... –  Reed Copsey May 13 '11 at 17:11
Great: We simply need to install .NET 4.0 SDK and the developers will set the target framework themselves. 1). Build 2).? 3). Profit! Now, one more question: Does it matter between 32bit vs. 64bit? –  David W. May 13 '11 at 19:02
If your assemblies are 'AnyCPU' (and they probably are) - no. If they call native code through P/Invoke - it does. –  skolima May 13 '11 at 21:08

You can target a different .NET framework from Visual Studio 2010 or from msbuild. A build project can be setup to target .NET 2.0, .NET 3.5, and .NET 4.

That being said, if it's the same project, there is no real reason to do this. Unless the .NET 4 version is adding additional features, there is no reason to not just target .NET 2, and build a single deployment, since this can be used from .NET 3.5 and .NET 4 projects without issues.

I would recommend installing Visual Studio 2010, as this will get you the version of msbuild that can target all 3 frameworks.

Unfortunately, if you're targetting .NET 1.1 (2003), this will require a separate build, and the newer versions of Visual Studio only support .NET 2.0+.

share|improve this answer
Thanks. Can we avoid installing VisualStudio? This system would strictly be an automated build server running under Jenkins and doing continuous builds. No one would be opening up VisualStudio on this system to actually run the builds. Heck, if we're lucky, no one would even be logging into this machine. –  David W. May 13 '11 at 18:08
@David: You should be able to do it with the .NET 4 SDK, as well. –  Reed Copsey May 13 '11 at 18:33

Even without MSBuild.exe, you may still be able to automate the build process for Visual Studio 2003 by using the command-line switches for devenv.exe - see the article titled "Building on the Command Line" at MSDN at http://msdn.microsoft.com/en-us/library/f35ctcxw%28v=vs.71%29.aspx

share|improve this answer

Your Answer


