.NET Assembly Incorrect Format Error

“Could not load file or assembly ‘ChilkatDotNet2, Version=9.3.0.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” The “incorrect format” error is a 32-bit vs. 64-bit mismatch.  It means the application is trying to load a 64-bit .NET assembly into a 32-bit process,  or the reverse (a 32-bit assembly into […]

Using regsvr32 to Register a 32-bit ActiveX or 64-bit ActiveX on Windows 64-bit System

A 64-bit Windows system has two separate registries — one for 32-bit processes, and one for 64-bit processes. The reason for this is simple: Let’s say your application instantiates an instance of an ActiveX component by calling CreateObject(“Chilkat.Ssh”). If your application is running in a 32-bit address space, the registry entries for “Chilkat.Ssh” should point to a 32-bit DLL in […]

Using 32-bit or 64-bit ActiveX Components on x64 Windows

64-bit Windows is capable of running applications in both 32-bit mode and 64-bit mode. If the application process is running in a 32-bit address space, the DLL must also use a 32-bit address space. (In other words, it should be a DLL compiled for the Win32 platform.) If the application process is running in a 64-bit address space, the DLL’s […]

Incorrect Format Error when trying to load .NET Assembly

This Chilkat blog post explains the following error: “Could not load file or assembly ‘ChilkatDotNet2, Version=9.0.8.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd’ or one of its dependencies. An attempt was made to load a program with an incorrect format.” When a DLL is loaded, it is mapped into the process’s address space. If the process is running in a 32-bit address space, the DLL […]

ActiveX on 64-bit OS; Which to use: 32-bit DLL or 64-bit DLL?

Question: Help clarify something for me please. I develop in a 32bit environment, but deploy to windows 2003/2008 64bit servers. Do I install the 64bit or the 32bit ActiveX on the servers? Answer: In Visual Studio C/C++ applications, you may target either win32 or x64. If your application targets win32, you should register (using regsvr32) and use the 32-bit Chilkat […]

ClickOnce w/ x64 DLL’s

I recently discovered this crucial bit of information: I compile my project for x86 systems (vs Any CPU or x64). Just wanted you to be aware of this. Your last email stated “You must deploy the x64 ChilkatDotNet2.dll to x64 systems” which is not correct.  This is an important consideration for “Click Once” deployments which do not have built-in conditional […]

x64 ActiveX Registration on Windows 2008 Server

For the most part, a 32-bit Chilkat ActiveX DLL will run on a 64-bit computer. However, there is an issue (to be explained here) that requires the ActiveX to be built specifically for x64. Chilkat provides separate 64-bit ActiveX’s on it’s downloads web page, and these should be used on x64 systems. The problem occurs when a method returns an […]

ChilkatDotNet2.dll on x64 from a Windows Service

Here’s the secret to getting the .NET runtime to load the ChilkatDotNet2.dll from a Windows Service: It must be installed in the GAC, but there’s a separate GAC for 64-bit assemblies: (with permission from the Chilkat customer) I was able to find a solution to this. I’m running a 64-bit version of Vista, and there turns out to be a […]

Download for Vista x64 (64-bit Microsoft Vista)

Question: I get an error when trying to load ChilkatDotNet2.dll on Vista x64: An attempt was made to load a program with an incorrect format. Does Chilkat have an x64-compatible .NET assembly? Answer: Yes, download the x64-compatible DLL from this URL: x64 compatible ChilkatDotNet2.dll Make sure you deploy the x64 DLL to the 64-bit Vista system. You may develop your […]