devenv command line does not show error for defect

2019-09-13 09:59发布

问题:

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?

回答1:

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.