Hi,
Here is an example project that can reproduce the issue:
https://dl.dropboxusercontent.com/u/46508238/forum.ncrunch.net/TestNCrunch-2013-06-01.zipSteps to reproduce the issue:
1. Create a new solution with a Class Library project and a Unit Test project.
2. Menu > Build > Configuration Manager > Add 'x86' as the platform for the test project.
3. Add 'TEST' to the 'Conditional compilation symbols' of the test project.
4. Add the following classes in Class Library project:
Code:
public class Class1
{
public Class1()
{
#if(!TEST)
new Class2();
#endif
}
}
public class Class2
{
}
5. Link Class1 to the test project.
6. Enable NCrunch.
7. NCrunch outputs the following build error:
Code:
..\TestNCrunch\Class1.cs (11)#0:
The type or namespace name 'Class2' could not be found
(are you missing a using directive or an assembly reference?)
To workaround this issue:
1. Menu > Build > Configuration Manager > Switch to 'Any CPU' for the test project.
2. Add 'TEST' to the 'Conditional compilation symbols' of the test project.
3. Menu > Build > Configuration Manager > Switch back to 'x86' for the test project.
Cheers,
Yang