Build/Test Issues

Tests fail because of relative path location

Started by SteveC on 4,419 views

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");

Ah ha ...

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.