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 ha开发者_运维问答d 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?
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!
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+.
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
精彩评论