0

We use Jenkins to build our solutions automatically. We call devenv (Visual Studio 2010) by a command line: devenv PathToProject\Project.sln /build Release

When the solution contains a defective project (*.vdproj, *.csproj), opening the solution in the Visual Studio IDE will result in an error message. But when building the solution with the above command line, no error message is shown at all, and consequently Jenkins reports success.

if you want to reproduce the problem, just open the vdproj file in an editor, and remove a } somewhere in the file.

How can that problem be solved?

Bernhard Hiller
  • 2,163
  • 2
  • 18
  • 33
  • I know this is obviously an issue for you currently, but do you really *frequently* end up with corrupted project files? How/why? Shouldn't you be solving that issue? – Damien_The_Unbeliever Oct 16 '12 at 07:11
  • 1
    Of course, this does not happen often. But the meaning of Continuous Integration is exactly that such problems should be detected automatically. – Bernhard Hiller Oct 16 '12 at 07:48

1 Answers1

0

On Visual Studio 2012, /Out writes the build messages to a text file.

devenv.exe YourVisualStudioSolution.sln /build "Debug|Win32" /Out "YourLogFile.txt"

According to MSDN, this switch should work on Visual Studio 2010 as well.

rwong
  • 6,062
  • 1
  • 23
  • 51
  • Thanks for the hint. Jenkins receives the output anyway and makes it available on the "Console Output" page of the build, i.e. writing the output to a file makes things more complicated only. And the return value of the devenv process won't change, would it? That's the pivotal issue here - return failure not success in case of failure. – Bernhard Hiller Feb 21 '14 at 07:47
  • The only way would be to parse the last line of devenv console output, that is, the line that says `========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========` using a tool like [`tail`](http://linux.about.com/library/cmd/blcmdl1_tail.htm). – rwong Feb 21 '14 at 16:48
  • @rwong Another annoyance is that in a solution with 23 project, that information is not enough; if it says "22 succeeded, 1 failed", it doesn't say which one fails. – Nyerguds Sep 05 '16 at 08:21