I'm currently using the following for my tests:
MVVMLight PCL (Portable Class Library version)
MSpec
NSubstitute
When tests run that include the following line of code in my ViewModels (Portable Class library referenced by Spec project)
if (this.IsInDesignMode)
{
// Set some properties
}
It will fail with the following exception:
System.IO.FileLoadException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
--- End of inner exception stack trace ---
Removing this line allows the tests to pass without failure. The reason I'm posting here though is because if I use ReSharpers test runner I don't get this exception, so it would seem to be an issue with the NCrunch test runner specifically.
At the moment, I'm forced to use the ReSharper test runner for these tests which reduces where I can use NCrunch significantly.
Any help with resolving this issue would be greatly appreciated.
Thanks
Garry Mc