title: Jenkins running C# nunit test in msbuild and not getting correct error code
body: <p>I am running a C# nunit test via Jenkins, the 'build' is successful, but the nunit test fails, when I check LASTEXITCODE I get 0 (success), is there a way of getting the actual result that nunit has.</p>
  
  <p>The output is:</p>
  
  <pre><code>Runtime Environment - 
     OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
     CLR Version: 4.0.30319.34209 ( Net 4.5 )
  
  ProcessModel: Default    DomainUsage: Single
  Execution Runtime: v4.0
  Run list: C:\Jenkins\workspace\regressionTests\TestList.txt
  
  Tests run: 1, Errors: 1, Failures: 0, Inconclusive: 0, Time: 45.106507 seconds
    Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
  
  Errors and Failures:
  1) TearDown Error :   
  USERACCOUNT = TESTUSER, DEFAULT_CLIENT = UNKNOWN, DEFAULT_ACCOUNT = UNKNOWN)
   Activating Dataflow Dialog
  Expected: True within 1000 millisecond delay
  But was:  False
  
  TearDown : System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
    ----&gt; System.NullReferenceException : Object reference not set to an instance of an object.
  </code></pre>
  
  <p>Any suggestions would be welcome, I tried searching StackOverflow and Google, but to no avail.</p>