Accessing ReturnCode from NUnitTeamCity task

The ReturnCode property of the NUnitTeamCity task seems like an obvious candidate for something that should be accessible when the task exits. However, if I define a task like this:


    <Output TaskParameter="ReturnCode" ItemName="NUnitExitCodes"/>

I receive the following message:

error MSB4065: The "ReturnCode" parameter is not marked for output by the "NUnitTeamCity" task.

I think this should be a simple matter of adding an attribute - is this something you could fix in the next release?
Comment actions Permalink

I've added an issue into issue tracker at, please vote for it.
Note, I've added a question for you there.

Comment actions Permalink

Hi Eugene, thanks for looking at this. I've commented on the issue in the tracking system, but I'm copying some of the reply here to see if anyone has another suggestion to achieve what I want.
The scenario I am thinking of is where I want to run tests from multiple assemblies by using MSBuild batching, and I want to:

  • continue running tests on all assemblies even if some of the tests fail,
  • fail the build afterwards if any of the tests failed, so that subsequent build stages do not occur.

    At the moment this is not easy with the NUnitTeamCity task. Is there another way to achieve this with the current tools?

    Comment actions Permalink

    You may switch to using TeamCity NUnit launcher.
    Please have a look at for more details.


    Please sign in to leave a comment.