I found the solution here, in the second answer: here
But all I did is built my app with target CPU x86 and copied DLLs within same path of my exe, and all worked well
Question
In my application (vs 2012) I'm using
Microsoft RDP Client Control
(COM) to connect remotely to a machine. It's working all well unless I run my exe on a 32bit OS, then BadImageFormatException is thrown!
Error log:
Could not load file or assembly Interop.MSTSCLib or one of its dependencies. The system cannot find the files specified.
1- I tried different versions of the COM (Microsoft RDP Client Control version 2 through 10), plus "Microsoft Terminal Services Client Control"
2- I tried to set the target platform to Any CPU, x86, x64
3- I tried to embed the library
I have to make sure this app works on both 64 and 32 bit OS, Any Ideas??
Solution
I found the solution here, in the second answer: here
But all I did is built my app with target CPU x86 and copied DLLs within same path of my exe, and all worked well