Differences between Visual Studio (.sln) build runner and MSBuild
I'm trying to set TeamCity to do a CI using .Net and configuring build runners I have:
What's the difference? Why three build to work on the same type of project? (With the exception of 2003 which is only for 2003 I believe, Why?)
Taking the issue, we have this build runners for .exe files:
The "Command Line" build runner not works with any .net assembly? Why the .Net Process Runner?
Visual Studio (sln)
If your solution is small and you are not required to do fancy things you can use Visual Studio (sln) build runner. It does exactly the same thing as when you do Project->Build (from VS menu). This option is very easy to configure, a few clicks and your CI server compiles your solution.
MSBuild
If you need to do more advanced scenarios, apart from simple compilation, like apply different config files, insert transformed values into config file, deploy binaries etc, you would select MSBuild option. You will know when you need to use this, simply because sln builder will not be capable of doing stuff. This option requires some knowledge of build scripting language, which is a task-based and xml-like.
When you use MSBuild to build a .SLN file ( non MSBuild document ) it generates an in memory MSBuild file that references all of the projects to build in the specified configuration and then executes it. When you use Visual Studio to build you are calling DevEnv.com instead.
There are certain project types ( C++ in 2005/2008 and VDPROJ in 2005/2008/2010 ) that aren't MSBuild files and can't be build using just MSBuild. You will get a build warning saying that one or more projects were not valid MSBuild projects and could not be built.
In geneneral I try to maintain lean and mean build machines and only install Visual Studio if needed.
I've noticed very little between the two. Specifically in our instance we needed to build a .vdproj. Now after googling there where two runners to do this, Command line runner or the Visual Studio (sln). However when doing the Visual Studio (sln) runner type we got the following error: "[Warning] C:BuildAgentwork1bd75058d7bca32bPOSPoSWidgetInstallermyInstaller.vdproj.metaproj warning MSB4078: The project file "myInstallermyInstaller.vdproj" is not supported by MSBuild and cannot be built."
And it doesn't fail when built in the solution. I think Visual Studio (sln) runner type pulls the data from the sln file and then uses it with MSbuild. Not sure can't confirm but just my thoughts on it.
链接地址: http://www.djcxy.com/p/81626.html