GreenMoose;6426 wrote:
1) What is "Additional files to include" meant to be used for? Why can't I reference my log4net.dll and NHibernate.dll at solution level by adding path e.g. "Externals\log4net.dll"?
'Additional files to include' is needed to specify files that NCrunch should copy to the workspace. This is basically the same as referencing them in the project file. It isn't intended to be used to specify files that should exist in the build output directory - although this is technically possible by including files that are in the bin\debug directory in the foreground solution, I generally don't recommend this because it creates a dependency on the foreground build (though sometimes this is the easiest option).
GreenMoose;6426 wrote:
2) When I alter configuration for a project, NCrunch creates a new workspace e.g. NCrunch\4972\152\, while the old NCrunch\4972\138\ is kept and content is identical. Is this a bug?
This is by design. NCrunch can have many workspaces for a single project and will create new ones when it needs to.
GreenMoose;6426 wrote:
*Edit: When having to copy log4net.dll and NHibernate.dll manually it starts to get real ugly since they are using nuget... Am a bit stalled of how to proceed, it works fine if I force devstudio to build the solution and then use "additional files to include" from e.g. bin\debug but it feels a pity having to first build solution with vstudio to get console tool running.
A cleaner option is to include the DLL files using 'Additional files to include' from their original place in your solution (i.e. nuget packages directory). You can then include a PostBuildEvent to copy the files into $(ProjectDir)$(OutDir) so that they exist in the same directory as the output file. Set a condition on the PostBuildEvent so that it will only run under NCrunch - condition="$(NCrunch) == '1'". This will remove the dependency on the foreground build while still allowing the files to land in the right place.
GreenMoose;6426 wrote:*Edit2: And when manually copying files I get warnings like below:
Code:
The following references raised this warning, something to be concerned about or can I simply ignore them?
E:\NCGNode\Workspaces\1544\370\Utils\Proj1\bin\Debug\log4net.DLL was expected to be loaded from E:\NCGNode\Workspaces\1544\370\_ncrunchreferences\log4net.dll
E:\NCGNode\Workspaces\1544\370\Utils\Proj1\bin\Debug\NHibernate.DLL was expected to be loaded from E:\NCGNode\Workspaces\1544\370\_ncrunchreferences\NHibernate.dll
Yes. Placing the files manually (or via PostBuildEvent) inside the output directory manually will trigger NCrunch to show these warnings, as it causes the CLR to load assemblies from places that NCrunch isn't expecting. As long as the DLLs are binary-equivalent to the files NCrunch is trying to reference, you shouldn't experience any runtime problems here.
GreenMoose;6426 wrote:*Edit3: And when trying with this solution I get fishy test failures like below
Code:
SetUp : System.MissingMethodException : Method not found: 'System.Collections.Generic.IList...
I think I need to get back to drawing board and compile entire project with vstudio as a first step before running it with NCrunch's console runner.
Try to avoid touching the files inside the workspaces manually, and make sure you don't copy around output files from other projects in your solution. Generally when I've seen this error occur, its because NCrunch is loading and resolving the wrong version of user-built assembly at runtime.