If a .NET assembly containing unmanaged code is compiled for win32 or x64, you cannot try to load it on the wrong type of system. You’ll get an error when trying to load a win32 DLL on x64, and you’ll also get an error trying to load an x64 DLL on win32.
The key to recognizing this problem is this error string: System.BadImageFormatException
For example:
************** Exception Text **************
System.BadImageFormatException: Could not load file or assembly 'ChilkatDotNet2,
Version=8.2.2.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd' or one of its
dependencies. An attempt was made to load a program with an incorrect format.
File name: 'ChilkatDotNet2, Version=8.2.2.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd'
at MyApp.Form1.button1_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button,
Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Note: Chilkat provides both win32 and x64 builds of the Chilkat .NET assembly for the 2.0 Framework.