Is the Microsoft RDP Client Control a native DLL?
If your .NET application is built for 64-bit, you'll also need to include a 64-bit native library. Likewise, the same goes for a 32-bit application. While your .NET program might be AnyCPU, or even 32-bit, and the native library isn't the right architecture of the current platform it's running on, you'll get a
BadImageFormatException[
^].
As far as I can see you have two/three options here, and for all options you'll need the 32-bit version of the
Microsoft RDP Client Control
library.
1) You compile your .NET program as x86. It'll be a 32-bit program (which runs perfectly on a 64-bit OS) and it'll load the 32-bit library.
2) You create two different versions of your .NET program. One 64-bit, and the other 32-bit. And with each version you redistribute the appropriate library.
2a) You can go down the road of making an AnyCPU application, however, you'd need to dynamically load the appropriate library then. Here's an
example[
^] of that.
Option 1 is probably the easiest to do, unless you find it really important to have a 64-bit version of your application on a 64-bit OS.