Rodney;7248 wrote:First this has nothing to do with dependent projects or referenced assemblies. This issue is just with the files within the actual test project that are not embedded resources and have the build action on none or content, and the copy to output directory set to copy always or copy if newer.
I have confirmed that NCrunch workspace does have the files in the src folder but not in the bin\debug\* folders where they are required, this is why I am reporting the issue.
I was having the same issue with NCrunch not picking up files marked as copy always.
When MS Test / R# runs the test, both the
AppDomain.CurrentDomain.BaseDirectory and
Assembly.GetExecutingAssembly().Location will be the same directory.
When NCrunch runs the test, the directories are different:
Code:
AppDomain (file *does not* exist):
C:\Users\<user>\AppData\Local\NCrunch\8648\2\<project>.UnitTests\bin\Debug\<file>.txt
Assembly (file *does* exist):
C:\Users\<user>\AppData\Local\NCrunch\8648\1\<project>\bin\Debug\<file>.txt
To accommodate this difference, check both paths for the file in question and all test runners should be able to find the file.