lundi 23 mars 2015

Unit test threw an exception: assembly built by a newer runtime

My solution wouldn't build with the dreaded "Could not load file or assembly xxxx or one of its dependencies", so after lots of searching, I ended up removing all the references and adding them back in one-by-one.


Now the solution builds, but my unit tests are throwing an exception: System.BadImageFormatException: Could not load file or assembly 'WorkflowBuilder_Accessor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.


I've deleted the accessor and recreated it, rebuilt the solution and added the references in again, but still the tests don't run. I'm not even sure which assembly is giving me the problem, but I have noticed something odd about visual studio UnitTestFramework.dll - when I look at the dll in windows explorer, it is version 10.0, but after it is added it shows as 10.1. Is this the problem?


Before adding reference - version 10.0 Before: version 10.0


After adding - version 10.1 After: version 10.1


I should add that, I have set target to x86 on all my projects, which is one of the suggested solutions I've seen.


Aucun commentaire:

Enregistrer un commentaire