Appveyor.NUnit3Logger.AppveyorTestEventListener.SuiteStarted null reference exception

Tzach Shabtay's Avatar

Tzach Shabtay

22 Feb, 2018 06:25 PM

Hi, I'm trying to run and report tests to Appveyor but getting:

Error processing test event: System.NullReferenceException: Object reference not set to an instance of an object.
   at Appveyor.NUnit3Logger.AppveyorTestEventListener.SuiteStarted(XElement suiteElem)
   at Appveyor.NUnit3Logger.AppveyorTestEventListener.OnTestEvent(String report)

Build log:

The line that I'm running: nunit3-console .\Source\Tests\bin\Release\Tests.dll --framework=net-4.5 --result='dummy.xml;format=AppVeyor'
From the script:

  1. Support Staff 1 Posted by Owen McDonnell on 28 Feb, 2018 01:46 AM

    Owen McDonnell's Avatar

    Hi, I couldn't find the error you referenced in the build log that you linked to (build for commit named "Appveyor- test results- take 3". It looks like you tried a few different test runners, with varying degrees of success. Is this still an issue for you?

  2. 2 Posted by Tzach Shabtay on 28 Feb, 2018 03:39 PM

    Tzach Shabtay's Avatar

    The error is there, perhaps you didn't wait for the whole build log to appear?
    Look in line 477 (and then every 4 lines, as this exception appears hundreds of times, probably once for every test- sometimes with SuiteStarted and sometimes with TestStarted).

    My workaround for this was to use nunit2 instead of nunit3 which works. However I would probably want to migrate to nunit3. There might be something I'm missing for working with nunit3, but AppVeyor throws that null exception without giving any proper reason of what's wrong.

  3. Support Staff 3 Posted by Owen McDonnell on 28 Feb, 2018 09:46 PM

    Owen McDonnell's Avatar

    Right, I see that now. I'll investigate.

  4. Support Staff 4 Posted by Owen McDonnell on 06 Mar, 2018 05:21 PM

    Owen McDonnell's Avatar

    There is something going awry when the appveyor extension off of the nunit3 console consumes the older nunit test results. So there are 2 workarounds available to you:
    1) Run the matching test runner for your test suite. i.e. if you want to migrate to nunit3, for best results, it would seem you should upgrade your test dll as well, otherwise stick with nunit2 runner as you currently do.
    2) add the following line to your appveyor.yml after other install scripts.
    - del "C:\tools\nunit3\appveyor.addins"

    Then change the format in the results flag to,

    If you want to see test results on test tab of build console you can add two lines after the test runner like so,
    nunit3-console .\Source\Tests\bin\Release\Tests.dll --framework=net-4.5 --result='myresults.xml;format=nunit3'

    $wc = New-Object 'System.Net.WebClient'

    $wc.UploadFile("$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\myresults.xml))

  5. 5 Posted by cedd on 10 Jul, 2018 07:38 AM

    cedd's Avatar

    Hi there

    I get this as well.

    I have a solution which has a mix of nunit2 and nunit 3 tests, and its awkward to update them all to nunit 3 for various boring reasons.

    I've done the workaround for now.



  6. Ilya Finkelshteyn closed this discussion on 27 Aug, 2018 06:21 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac