When an application that references DotImage, DotTwain, DotAnnotate or any of our add-ons is compiled on a 64-bit system you may run into a couple issues.
Our assemblies are available in 32 bit ('x86') and 64 bit ('x64); When compiling on a 32 bit system, if you happen to leave the platform target set to 'AnyCPU' (The default for some versions of Visual Studio) things work fine for you, but cause problems the minute you run the retulting application on a 64 bit machine. Therefore any applications using DotImage components must specify a platform target of either 'x86' or 'x64' and must use the corresponding Atalasoft dlls.
Note that you do not NEED to compile to x64 in order for your applications to wok on x64 systems. Unless you have a specific need to build x64-only applications, target x86 and your applications will run on both 32 and 64 bit Windows.
In summary, changing the "Platform Target" setting on the Build tab of your project settings to x86 or x64 and make sure the Atalasoft references used all match that "bitness". Without this setting you will receive a BadImageFormatException when running your application.
When building x64 applications, there are some issues related to the fact that Visual Studio itself is actually a 32 bit process, and there There is a bug in some Visual Studio versions that will try to run the License Compiler in the wrong (x64 / x86) mode. To work around this you may need to to add pre-build and post-build events to your project. Here are the settings for those events:
For problems building x86 targeted apps:
Pre-Build:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe setwow
Post-Build:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64 set64
For problems building x64 targeted apps:
Pre-Build:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64 set64
Post-Build:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe setwow
The paths for these events may need to be modified for your specific system.
You must run Visual Studio as admin to add these build events.