A project file tests.nunit with contents
<NUnitProject>
<Settings activeconfig="Release"/>
<Config name="Release">
<assembly path="..\MyProject.Test\bin\Release\MyProject.Test.dll"/>
</Config>
</NUnitProject>
run from cmd like so:
D:\projects\MySolution\MyTestStuff>"nunit3-console.exe" tests.nunit
causes the nunit console to crash with this error message:
_Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified._
Moving everything back a directory and updating the tests.nunit like so causes the test to run normally. The crash seems to be caused by the "..\" in the project file path.
<assembly path="MyProject.Test\bin\Release\MyProject.Test.dll"/>
Doing this from the command-line also works correctly:
D:\projects\MySolution\MyTestStuff>"nunit3-console.exe" ..\MyProject.Test\bin\Release\MyProject.Test.dll
In the first (failing) command, the appbase is set to the location of the project file by default. This makes it impossible to load assemblies that are not in or below that directory.
Options...
Charlie, would you mind explaining what you mean by 'appease' and 'soonest'? Just looking at the .nunit config file example in the docs I can't figure out what you're talking about.
https://github.com/nunit/docs/wiki/NUnit-Test-Projects
I hate auto-correct! Appbase in both cases.
Heh, thanks. That makes _much_ more sense.
If anyone finds this through google, here's what I should have done if I want to put my .nunit file in a sub-directory:
<NUnitProject> <Settings activeconfig="Release"/> <Config name="Release" appbase="..\"> <assembly path="MyProject.Test\bin\Release\MyProject.Test.dll"/> </Config> </NUnitProject>
Most helpful comment
I hate auto-correct! Appbase in both cases.