1

Closed

NullReference when trying to write log to xml

description

I don't know what character is causing it to barf but here's the stack:

[06:33:27][MSBuild output] Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
[06:33:27][MSBuild output] at Xunit.Runner.MSBuild.TeamCityLogger.Escape(String value)
[06:33:27][MSBuild output] at Xunit.Runner.MSBuild.TeamCityLogger.TestFailed(String name, String type, String method, Double duration, String output, String exceptionType, String message, String stackTrace)
[06:33:27][MSBuild output] at Xunit.XmlLoggerAdapter.LogTestNode(XmlNode testNode, IRunnerLogger logger)
[06:33:27][MSBuild output] at Xunit.XmlLoggerAdapter.LogNode(XmlNode node, IRunnerLogger logger)
[06:33:27][MSBuild output] at Xunit.TestRunner.<>c__DisplayClass2.<RunAssembly>b__1(XmlNode node)
[06:33:27][MSBuild output] at Xunit.ExecutorWrapper.XmlNodeCallbackHandlerWithIMessageSink.System.Runtime.Remoting.Messaging.IMessageSink.SyncProcessMessage(IMessage msg)
[06:33:27][MSBuild output] at System.Runtime.Remoting.Messaging.IMessageSink.SyncProcessMessage(IMessage msg)
[06:33:27][MSBuild output] at Xunit.Sdk.ExecutorCallback.MessageSinkCallback.Notify(String value)
[06:33:27][MSBuild output] at Xunit.Sdk.Executor.OnTestResult(ITestResult result, ExecutorCallback callback)
[06:33:27][MSBuild output] at Xunit.Sdk.Executor.RunAssembly.<>c__DisplayClass9.<>c__DisplayClassd.<.ctor>b__6(ITestResult result)
[06:33:27][MSBuild output] at Xunit.Sdk.TestClassCommandRunner.Execute(ITestClassCommand testClassCommand, List1 methods, Predicate1 startCallback, Predicate`1 resultCallback)
[06:33:27][MSBuild output] at Xunit.Sdk.Executor.RunAssembly.<>c__DisplayClass9.<.ctor>b__4()
[06:33:27][MSBuild output] at Xunit.Sdk.Executor.ThreadRunner(Object threadStart)
[06:33:27][MSBuild output] at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
[06:33:27][MSBuild output] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[06:33:27][MSBuild output] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[06:33:27][MSBuild output] at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[06:33:27][MSBuild output] at System.Threading.ThreadHelper.ThreadStart(Object obj)

I'm using:
xunit.runner.msbuild, Version=1.9.0.1566, Culture=neutral, PublicKeyToken=null

I also saw this locally so I don't think it's a teamcity specific issue.
Closed Nov 17, 2012 at 9:20 AM by BradWilson
Dup of 9793, already fixed in 1.9.1

comments

dfowler wrote Nov 17, 2012 at 7:21 AM

I'm using:
// xunit.runner.msbuild, Version=1.9.0.1566, Culture=neutral, PublicKeyToken=null

I'll update the runner to the latest and see if I can get it to repro