# Build 1754: MsTest action throws NRE

**URL:** <https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935>\
**Category:** Discussion\
**Created:** [April 5, 2013, 8:01am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935 "2013-04-05T08:01:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 5, 2013, 8:01am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/1 "2013-04-05T08:01:01Z")

</div>

Hi, it seems, the unit tests were green, but at the end, an NRE is thrown.

This is shown in the log:

| Passed EntityTests.IRevertableChangeTracking  
 Passed EntityTests.Nulls  
 Passed EntityTests.SerializeArray  
 Passed EntityTests.SerializeNonArray  
 Passed EntityTests.SetDirtyReadOnly  
 Passed EntityTests.SetReadOnly  
 80/80 test(s) Passed  
  
 Summary  
 -------  
 Test Run Completed.  
 Passed 80  
 ----------  
 Total 80  
 Results file: C:\BuildAgent\Ws\44\MSTestOutput\_130096146394719387.trx  
 Test Settings: Default Test Settings  
  
 |
| Action has failed due to an error.  
 Object reference not set to an instance of an object. |

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 5, 2013, 8:59am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/2 "2013-04-05T08:59:30Z")

</div>

Hi Christian   
  
 I haven’t been able to reproduce this here, so I suspect there must be something in the trx file we are not parsing properly. Are you able to send us the trx file (to support at [finalbuilder.com](http://finalbuilder.com)) so we can run the parser over it under the debugger?

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 5, 2013, 9:10am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/3 "2013-04-05T09:10:44Z")

</div>

Also, which version of MSTest are you using?

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 5, 2013, 9:48am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/4 "2013-04-05T09:48:20Z")

</div>

I’am using mstest from Visual Studio 2010 Professional (10.0.30319).   
  
 The TRX has been sent via mail right now.

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 5, 2013, 10:23am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/5 "2013-04-05T10:23:29Z")

</div>

Hi Christian   
  
 Is this error repeatable? So far I have not been able to reproduce the problem, and the parser is able to parse the trx file without any problems.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 5, 2013, 10:44am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/6 "2013-04-05T10:44:16Z")

</div>

yes it is repeatable.   
  
 is it possible to look for a callstack or something in the log files? some debug output option, so i can assist you?

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 5, 2013, 11:02am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/7 "2013-04-05T11:02:35Z")

</div>

We will need to modify the action as the stack trace is not being logged.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 5, 2013, 11:14am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/8 "2013-04-05T11:14:58Z")

</div>

so it seems it depends on one of our projects. i’ve tested both separatly and the last one finished successfully. the other one throws the exception.   
 maybe i can find the difference in visual studio. i’ll have a look.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 5, 2013, 12:00pm UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/9 "2013-04-05T12:00:04Z")

</div>

so the NRE comes directly before any test is executed. so it seems it has nothing to do with the TRX file. must happen before or with the execution of mstest.exe

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 5, 2013, 1:22am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/10 "2013-04-05T01:22:38Z")

</div>

i can’t find anything. waiting for the log now.

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 6, 2013, 3:50am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/11 "2013-04-06T03:50:05Z")

</div>

What settings do you have on your MSTest action. I have changed the error handling so that it logs the stack trace when parsing the results file, however so far I have not been able to get any errors.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 8, 2013, 7:42am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/12 "2013-04-08T07:42:17Z")

</div>

as is said, its only throwing that NRE on one specific project. all other work. as the action occurs, before any output is visible, i think is doesn’t depend on the TRX file at all.   
 i’ve just set the pattern for .dll test libraries. nothing special.

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 8, 2013, 8:00am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/13 "2013-04-08T08:00:15Z")

</div>

Ok, test again with the next build (hopefully later today) and lets see what the logging reports.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 9, 2013, 3:02am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/14 "2013-04-09T03:02:44Z")

</div>

An Error occurred parsing results file : C:\BuildAgent\Ws\99\Source\MyProject\Bin\Tests\Results.trx.   
  
 Is that all? No exception info?

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 9, 2013, 3:10am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/15 "2013-04-09T03:10:57Z")

</div>

Hmmm… it should be logging more than that in the build log.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 9, 2013, 3:22am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/16 "2013-04-09T03:22:01Z")

</div>

seems not.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 9, 2013, 7:24am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/17 "2013-04-09T07:24:34Z")

</div>

who is parsing the .trx file? some internal code or do you use something i can test here by mysql?   
 because the tests were executed and the result file seems to be complete.

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [April 10, 2013, 12:32pm UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/18 "2013-04-10T12:32:10Z")

</div>

We are, it’s an xml file. That’s why I asked you for your trx file before, I added a unit test to parse the file and it it’s parsing fine. I will look at the logging again today and try parsing and invalid file. What would be really useful is if you are able to provide us with the assemblies you are testing, then we would be able to run the action against them and see what is going on. Don’t post them here, zip up and email to support at [finalbuilder.com](http://finalbuilder.com)

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 10, 2013, 8:08am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/19 "2013-04-10T08:08:03Z")

</div>

“mysql”? i mean “myself” i’ll check this and send them to you, if possible.

---

<div class="post-metadata">

**Author:** ![christian.leh](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/67e7ee/32.png) [@christian.leh](https://www.finalbuilder.com/forums/u/christian.leh)\
**Post date:** [April 23, 2013, 2:17am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/20 "2013-04-23T02:17:22Z")

</div>

so i’m not permitted to send you those assemblies. Isn’t it possible to simply log the exception message etc, so we can get closer to it?

[Next page](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935.md?page=2)
