Search code examples
nunitnunit-console

Why do we need --dispose-runners parameter in NUnit Console


Referring to the --dispose-runners command line here

My question is of course the runner agent is disposed when the nunit console process completes, so why do we have to specify it at all?

Is there a specific function for that command line that I'm not aware of?


Solution

  • The DisposeRunners setting is actually an engine setting and is needed there because the engine is used by many runners. Some runners, unlike the console runner do not exit at the end of the run and may still need the information about tests provided by the runners.

    So, in fact, the console runner doesn't need this setting. I made a change in 2016 so that it was ignored but the setting was left in place in order to avoid breaking scripts that used it. It could have been completely removed as a breaking change with version 4 but it seems it was not.