I meet an exception says”BadImageFormatException unhandled” when I use Z3 C# API. In fact I have added the reference of “Microsoft.Z3.dll” and I use .NET framework 4.0. The detailed the information is
Could not load file or assembly ‘Microsoft.Z3, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=9c8d792caae602a2’ or one of its
dependencies. An attempt was made to load a program with an incorrect
format.
So what’s the problem?
See the answers to this question:
An error appears when running Z3 in C#
It’s probably related to the Platform target you’ve selected in your project properties: x86, x64 or AnyCPU. Reference the 32-bit or 64-bit version of Microsoft.Z3 as appropriate.
Lots of other suggestions at the above link too.