What is the difference between using 'devenv&#

2020-06-03 04:48发布

问题:

What is the main difference between using the <devenv> tag and the <msbuild> tag is in CruiseControl.NET?

I understand they call different executables, but sometimes I get different results (as far as pass/fail at compile time), and I would like to know why there is a difference between the two build commands.

回答1:

Basically devenv (Visual Studio) wraps MSBuild and add lots of Visual Studio specific properties.

To use devenv you need Visual Studio installed on your computer. To use MSBuild you only need to have the .NET framework.



回答2:

For us, the major difference is that devenv will handle installer projects (*.vdproj) while msbuild will not. If I recall correctly, msbuild is much less forgiving when it comes to finding referenced assemblies (especially if the paths are slightly off.)



回答3:

One of the things we discovered as we moved to TFS (which uses msbuild, at least as we have it configured) from VSS/CruiseControl.NET (which I'm guessing used devenv in our configuration) is that sometimes the ProjectGuids get out of sync.

So, Project A references Project B and the project or solution file for Project A has the ProjectGuid and path to Project B's project file. However, for whatever reason Project B's ProjectGuid has changed and Project A's project or solution file didn't get updated to reflect this.

Devenv is fine because it either just uses the file path to Project B's project file or it falls back to it. Msbuild, however, stops cold at this point because if the ProjectGuids don't match it's a no-go. At this point you can either fix it in Visual Studio (I think removing and re-adding the project works) or manually through Notepad or something.

I'll leave it up to you to decide which is better (strict adherence to the ProjectGuid or leniency when the path to the project is known)