Home : Compiling with DotImage on a 64-bit system
Q10149 - INFO: Compiling with DotImage on a 64-bit system

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:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe setwow

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64 set64

For problems building x64 targeted apps:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64 set64

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.

For more information, please see:

Q10165 - FAQ: Cause of System.BadImageFormatException

Q10406 - FIX: Drag-Drop of Some Atalasoft Viewers Not Adding Control to Designer

Q10341 - INFO: Workaround for a license compiler exception on 64-bit systems with VS2010 .Net 4.0

Q10288 - INFO: Workaround for a license compiler exception on 64-bit systems with VS2008/VS2010 .Net 2.0

Q10158 - INFO: Warning:Referenced assembly targets a different processor

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?


Tell us why you rated the content this way. (optional)
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2018. InstantASP Ltd. All Rights Reserved