Tests fail because of relative path location
I've got solution with three projects; console app, library and tests
The library has a folder with some files in, which are set to Copy to Output Directory if newer
And on built, the folder is created in the console apps \bin\debug and the files are there
Run the tests using Resharper's test runner and all are Green
BUT NCrunch is failing with exception ... System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\sculshaw\AppData\Local\NCrunch\16560\3\Library\bin\Debug\data\basic.txt'
The library is reading the files with ... File.ReadAllText(@".\data\basic.txt");
Remco NCrunch Developer
#11769
09 Feb 2018 11:56 UTC
Hi, thanks for sharing this issue.
Note that NCrunch will not copy the resource files from referenced projects unless the 'Copy Referenced Assemblies To Workspace' setting is enabled for the projects involved. This is because changes to these files require the build chain to work differently. See here for more details - http://www.ncrunch.net/documentation/considerations-and-constraints_assembly-colocation-assumptions.
Note that NCrunch will not copy the resource files from referenced projects unless the 'Copy Referenced Assemblies To Workspace' setting is enabled for the projects involved. This is because changes to these files require the build chain to work differently. See here for more details - http://www.ncrunch.net/documentation/considerations-and-constraints_assembly-colocation-assumptions.
Ah ha ...
Yeap enabling the 'Copy Referenced Assemblies To Workspace' setting did the trick
And many thanks for the quick response
Cheers,
SteveC.
Yeap enabling the 'Copy Referenced Assemblies To Workspace' setting did the trick
And many thanks for the quick response
Cheers,
SteveC.
Post a reply
Log in to reply.