If I have a method as below that demonstrates my problem.
Code:
public static void Junk()
{
unsafe
{
}
}
NCrunch has a build failure. It has the following message.
Quote:Libraries\NumKeys.cs (157, 13): Unsafe code may only appear if compiling with /unsafe
WARNING - ..\..\..\..\program files (x86)\microsoft visual studio\2017\professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (2110, 5): MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Users\andrewc\AppData\Local\NCrunch\18788\24\_ncrunchreferences\FairCom.IsamMtc.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
All my projects in this solution have "allow unsafe code" checked and compile ok without NCrunch. I'm currently getting past this by wrapping the unsafe code with #if !NCRUNCH/#endif which allows it to compile, but obviously prevents me from being able to test the code.
In the NCrunch configuration, I have the "Use CPU architecture" set to "x86".
Is there some way to allow this to build with NCrunch enabled so I'm able to run tests against it ?