# 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:** 12\
**Page:** 2

<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:** [May 2, 2013, 11:04am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/21 "2013-05-02T11:04:14Z")

</div>

so no exception details in the release for me? not that good

---

<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:** [May 2, 2013, 11:19am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/22 "2013-05-02T11:19:08Z")

</div>

I’m not sure if the mstest action itself was changed, however the exception logging for all actions was changed this week to make it clearer. I can only suggest that you try it again.

---

<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:** [May 2, 2013, 2:09am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/23 "2013-05-02T02:09:14Z")

</div>

as expected: i’m still getting the “An Error occurred parsing results file : …” message. i think this is because you introduced some Try … Catch for this message some time ago but the original exception is not rethrown (as it was when opening this thread), so i have no benefits of this new exception logging stuff.

---

<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:** [May 2, 2013, 3:02am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/24 "2013-05-02T03:02:26Z")

</div>

It should be logging the exception with a stack trace :

catch (Exception ex){&nbsp;

context.SendLogMessage(new Message(MessageStatusType.Error,String.Format(“An Error occurred parsing results file : {0}.”, this.\_resultsFile,ex.ToDetailedString())));&nbsp;

return false;&nbsp;

}&nbsp;

public static string ToDetailedString(this Exception exception)   
{&nbsp;

StringBuilder result = new StringBuilder();var currentException = exception;&nbsp;  
while (currentException != null)   
{&nbsp;

result.AppendFormat(“Exception: {0}{1}”, currentException.GetType().Name, Environment.NewLine);   
result.AppendFormat(“Message: {0}{1}”, currentException.Message, Environment.NewLine);   
result.AppendFormat(“Stack Trace: {0}{1}”, currentException.StackTrace, Environment.NewLine);   
result.AppendLine();currentException = currentException.InnerException;   
}&nbsp;

return result.ToString();&nbsp;

}&nbsp;

  
I will do some more testing tomorrow.

---

<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:** [May 2, 2013, 3:03am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/25 "2013-05-02T03:03:05Z")

</div>

Arrhhhgggg these forums are driving me mad… keeps messing up my formatting.

---

<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:** [May 2, 2013, 3:08am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/26 "2013-05-02T03:08:21Z")

</div>

i know what you mean am i blind or is the “{1}” missing after the “{0}”?

---

<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:** [May 2, 2013, 3:29am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/27 "2013-05-02T03:29:06Z")

</div>

Doh… I think I need a holiday. I’ll post a link to a test build here tomorrow.

---

<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:** [May 2, 2013, 3:31am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/28 "2013-05-02T03:31:59Z")

</div>

daily bugs so lets see what happens tomorrow. thank you so far.

---

<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:** [May 3, 2013, 9:45am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/29 "2013-05-03T09:45:51Z")

</div>

Hi Christian   
  
 This builds have the exception logging changes, let us know how it goes :   
  
 [http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup\_x64\_1.0.0.2002.exe](http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup_x64_1.0.0.2002.exe)   
  
 [http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup\_1.0.0.2002.exe](http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup_1.0.0.2002.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:** [May 3, 2013, 10:01am UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/30 "2013-05-03T10:01:05Z")

</div>

[code]Exception: NullReferenceException Message: Object reference not set to an instance of an object. Stack Trace:at Continua.Modules.Builds.Common.Services.DataTransferObjects.UnitTestDTO…ctor(Guid configurationId, Int32 buildId, Guid stageId, String assemblyName, String testNamespace, String testFixture, String testName, Boolean testSuccess, String testResult, String messages, String stackTrace, Boolean testExecuted, Decimal testTime, Boolean shelved) at Continua.Modules.Builds.Agent.AgentStageSteppingContext.CreateUnitTest(String assemblyName, String namespace, String fixture, String test, Boolean success, String testResult, Boolean executed, Decimal time, String messages, String stackTrace)at Continua.Modules.Builds.UnitTests.ParserHelpers.MSTestParserHelper.CreateTests(TestRun testResults, IBuildSteppingContext context)at Continua.Modules.Builds.UnitTests.ParserHelpers.MSTestParserHelper.ParseReport(IBuildSteppingContext context, String reportFilename)at Continua.Modules.Builds.Stepping.Actions.MSTestAction.OnInterpretResult(IBuildSteppingContext context, Int32 exitCode) [/code]

---

<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:** [May 3, 2013, 12:01pm UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/31 "2013-05-03T12:01:52Z")

</div>

I think I may have found the problem but don’t know for sure since I wasn’t able to reproduce the problem here :   
  
 [http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup\_x64\_1.0.0.2005.exe](http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup_x64_1.0.0.2005.exe)   
  
 [http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup\_1.0.0.2005.exe](http://downloads.finalbuilder.com/downloads/continua/1.0/ContinuaCI.Server.Setup_1.0.0.2005.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:** [May 3, 2013, 12:58pm UTC](https://www.finalbuilder.com/forums/t/build-1754-mstest-action-throws-nre/4935/32 "2013-05-03T12:58:41Z")

</div>

yeah, everything is green now. whatever you did, it works thank you.

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