Remco;1917 wrote:[...] or by turning on the 'Copy Referenced Assemblies To Workspace' setting.
Unfortunately, I tried setting this (on both the unit test project and the class library project it's testing) but it still showed the same problem.
After a bunch of debugging, the root cause seems to be how the Ninject automatic module registration works - specifically, where it looks.
The key bit is in the ModuleLoader class:
https://github.com/ninje...les/ModuleLoader.cs#L77
It searches based on
Code:
AppDomain.CurrentDomain.BaseDirectory
While running under MSTest or the R# runner, that property points to the 'normal' build output directory for the test project (...\Foo.Tests\bin\Debug)
However, when running under NCrunch, it's somewhere under the NCrunch working directory - in my testing,
Code:
C:\Users\james\AppData\Local\NCrunch\2952\50\TestResults\6696e3c6-f2a0-40d7-af01-97c56fc50bd2\Out
Does NCrunch use separate AppDomain's, or are all the test runs done in a single one? In any case, if there's some way to get the AppDomain's BaseDirectory to be a place that has the assemblies used during the test (instead of that output directory), it would at least fix the users of Ninject. :)
Is there some different place it could/should look? I'm not sure Ninject would change behavior since it works for runners like R#, but it's worth a shot. :)