tags:

views:

193

answers:

1

hi, i have created a simple "public ref class" in the vc++ project, which is configured to generate a dynamik library. In the c# Project (simple console application) i added the vc++ project as to the References and doing a "using myVC++library". But when i try to create an object from the vc++ dll i always get: System.BadImageFormatException was unhandled

any clues or helpfull tutorials on this?

TIA

+1  A: 

Is your c# project set to build for "Any CPU" - if it is, and you're on a 64-bit OS, then the load will fail.

The VC++ dll will be 32-bit only, and 64-bit app can't run it.

You could change your c# build to target x86 instead.

marklam
thx, this solved the Problem.
helpless