Having recently started developing in Vista 64bit, this is an exception that I’ve bumped my head against a couple of times.

“An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)”

If you’re in a 64bit environment, your solution is targeting “Any CPU” and you try to link to a 32bit library you’ll get this exception at runtime. Note that this doesn’t apply to just .NET libraries, if you’re linking to a native library you’ll get this exception too.

There’s an easy way to prove for certain that this is your issue by changing the the platform your targeting to x86 (you might need to use configuration manager to add the x86 solution platform).

Comments are closed.