Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Tests fail because of relative path location
SteveC
#1 Posted : Friday, February 09, 2018 11:26:11 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/9/2013(UTC)
Posts: 12
Location: United Kingdom

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
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
#2 Posted : Friday, February 09, 2018 11:56:46 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,049

Thanks: 672 times
Was thanked: 797 time(s) in 758 post(s)
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.
1 user thanked Remco for this useful post.
SteveC on 2/9/2018(UTC)
SteveC
#3 Posted : Friday, February 09, 2018 12:05:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/9/2013(UTC)
Posts: 12
Location: United Kingdom

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
Ah ha ...

Yeap enabling the 'Copy Referenced Assemblies To Workspace' setting did the trick

And many thanks for the quick response

Cheers,
SteveC.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.021 seconds.