Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

July 24, 2007

ASP.NET 2.0 - Could not load file or assembly: win32 vs x64 DLL

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=, 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=, 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.

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.