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 installations as do MSI installations. So by compiling for x86, “Click Once” deployments need only distribute the 32 bit version of Chilkat for both 32 and 64 bit systems.
My understanding has been refined to this: It is possible to run either x86 or x64 EXE’s on the x64 architecture, however, DLL’s loaded by the EXE must match the architecture of the EXE (x86 or x64). My guess is that an EXE created in a managed .NET application compiled to “Any CPU” would be required to load a DLL matching the processor architecture.
The Windows Registry can also be an issue. This post describes how the registry on x64 Windows is divided into 32-bit and 64-bit keys. If your EXE is loading an ActiveX DLL (not a .NET assembly) then an x86 EXE would be reading the x86 keys, but if the ActiveX registry information is in the x64 keys, you’ll get an error when trying to create the object — probably a “class not registered” type of error.