CreepyGnome;8858 wrote:Well its not my code, but a private API written by another group in the company. The XML file is required to be in the same directory as the executing application and the DLL that requires it. This made me think that NCrunch is launching the unit tests from _ncrunchreferences and that the only file not in that directory is this XML file. I can run some tests on money, by checking the various assembly loading methods and use them in a unit test to see what locations it thinks it is in and where it trying to load assemblies from.
This makes sense. If the DLL is attempting to load its resources from its own directory, then it will be trying to load from _ncrunchreferences instead of the build output directory of your project.
Turning on the 'Copy referenced assemblies to workspace' setting will likely solve this problem, as the DLL will then be copied into the build output directory and will be loaded from there (where the resource file will be adjacent). However, there will be a significant performance penalty for this. If there is a way you can copy the resource file into _ncrunchreferences as a post build step or inside your test code itself, this might be better. If there is a way you can convince the other team to introduce a fallback in the resource file search logic (checking the current directory or the application domain base directory), this would create the best result.