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

Notification

Icon
Error

CopyReferencedAssembliesToWorkSpace when false still uses workspace and not output folder.
BookSwapSteve
#1 Posted : Tuesday, December 20, 2011 2:13:11 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/20/2011(UTC)
Posts: 6
Location: Cambridge

Was thanked: 1 time(s) in 1 post(s)
Hi,

My tests require xml files local to the executing assembly, I've set CopyReferencedAssembliesToWorkspace as false for all my projects, however NCrunch appears to be running the assembly in a temp folder, so the xml files are not getting picked up. I would expect/hope this was the same as ShadowCopy, which I have disabled.

Exception: FileNotFoundException. Could not find file c:\users\<username>\AppData\Local\NCrunch\10624\66\<ProjectFolder>\bin\debug\SampleData\<file>.xml

Is this by design? Or do I need to embed my xml files?

Cheers,

Steve.
Remco
#2 Posted : Tuesday, December 20, 2011 8:54:48 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,140

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Steve,

NCrunch moves the files within your project over to a workspace where they can then be built and have their tests executed.

In order to copy the files, it needs to know which files to copy. It looks to me like the .xml file you are expecting is not referenced within your .proj file, or perhaps its referenced in a manner that NCrunch doesn't understand.

The easiest way to solve this problem is to add a relative reference to the file using the AdditionalFilesToInclude configuration option on the offending project. In this way, NCrunch will know about the file and will be able to copy it to the workspace.


Cheers,

Remco
BookSwapSteve
#3 Posted : Tuesday, December 20, 2011 11:32:47 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/20/2011(UTC)
Posts: 6
Location: Cambridge

Was thanked: 1 time(s) in 1 post(s)
Hi,

I discovered the Additional Files option shortly after posting, I'll check that out another day, for now I've just ignored the test fixture.

The files are referenced by the project and set to Copy Always, I don't know if that's something you can pick up on and automate, or just a case of learning how the tool works.

Thanks,

Steve.
Remco
#4 Posted : Wednesday, December 21, 2011 2:45:44 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,140

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
It often helps to have a browse around the workspace NCrunch has built to see if the file exists in the place you would expect it to. You can do this by right-clicking on a project in the tests window, then choosing to browse to the workspace. If there are files required by your tests that are missing from the workspace but they exist in your solution path, then the additional files to include setting may prove a solution to this.

Also ensure that your test is referencing the xml file using the correct path - it should be a relative reference identical to that used in your solution outside the workspace.
Users browsing this topic
Guest
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.041 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download