12

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
codewario
  • 19,553
  • 20
  • 90
  • 159

3 Answers3

22

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Benjamin Baumann
  • 4,035
  • 2
  • 25
  • 35
8

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.)

Pedro
  • 12,032
  • 4
  • 32
  • 45
  • 1
    +1 for signaling vdproj project. As for the dependency look up, I think it's the same for VS and MsBuild, as defined in Microsoft.Common.Targets (see here : http://www.beefycode.com/post/Resolving-Binary-References-in-MSBuild.aspx ) – Benjamin Baumann Feb 15 '11 at 15:43
  • 2
    I have seen cases where a solution will build in VisualStudio, but won't directly from msbuild due to assemblies not in the correct location. VisualStudio seems to do a search in the code tree, and will correct path issues. I was assuming devenv.exe would do the same auto-correction, but that may not be the case. – Pedro Feb 15 '11 at 17:02
5

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)

Tom Kidd
  • 12,830
  • 19
  • 89
  • 128