Take the 2-minute tour ×

So we are running a command line app as part of the build but when there is an exception that causes the command line tool not to run correctly the build still flags that step as passed. Is there a way to report back to the build there as an exception?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Make sure your console app is returning a non-zero exit code in the event of an exception, and writing to StdErr instead of StdOut.

This post describes how to write a console app in C# to behave appropriately.

Correct way to implement C# console application?

share|improve this answer

You can check the envelopment variable %ERRORLEVEL% after you run the command

share|improve this answer

Your Answer


