.

[Resolved!] System.BadImageFormatException: The format of the file ‘xxx’ is invalid

I got the following error during unit testing.
System.BadImageFormatException: The format of the file ‘xxx’ is invalid

reason was that the project I tested was X86 but my testing application was “Any CPU”

Solution:
ensure that all your projects compile to the same platform, for example:
double click on your “properties” folder
set all individual platforms targets (of all your projects) to e.g. x86

that should resolve it.

– any other issues / solutions, please post below!

 

What's your thoughts on this?

*

Protected by WP Anti Spam