LEADTOOLS Support
General
LEADTOOLS SDK Examples
Could not load or assembly or an attempt was made to load a program with incorrect format
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, October 22, 2012 11:19:01 PM(UTC)
Groups: Registered
Posts: 2
Hi,
In my application i am using LEADTOOLS dlls .
I added all the dlls required but still i am getting the error
"Could not load file or assembly Leadtools.Kernel.Codes.dll" or one of its dependencies . An attempt was made to load a program with incorrect format.
I added below dlls.
* Leadtools.Codecs.dll
* Leadtools.Codecs.Tif.dll
* Leadtools.dll
* Leadtools.ImageProcessing.Color.dll
* Leadtools.Kernel.Codecs.dll
* Leadtools.Kernel.Codecs.Interfaces.dll
* Leadtools.Kernel.dll
* Leadtools.Twain.dll
* Leadtools.WinForms.dll
Edited by moderator Thursday, August 22, 2019 8:47:49 AM(UTC)
| Reason: Fixed formatting
#2
Posted
:
Tuesday, October 23, 2012 7:30:12 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
The problem might be related to the Platform specified on your project.
For example, if you are building a 32-bit application on 64-bit operating system, please make sure that you are using the x86 platform on the Debug Configuration Platform. Do not use the "Any CPU" setting.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
#3
Posted
:
Wednesday, October 24, 2012 9:07:13 PM(UTC)
Groups: Registered
Posts: 2
I have changed it to *86 still i am getting the same problem.
#4
Posted
:
Thursday, October 25, 2012 6:49:03 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The incorrect format exception is specifically indicating that the application is loading DLLs in the wrong format (trying to load 64bit DLLs from a 32bit process or vice versa). Please do a Build->Clean, and then Build->Rebuild and double check that all of the assemblies in the application's path are 32bit.
If all of the DLLs in the application's path are 32bit, it's possible that the application is trying to load DLLs from another location that are of the wrong target platform. You can use Process Explorer to determine what the exact locations are of the DLLs being loaded by the application:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
If you find that DLLs are being loaded from another location and are of the wrong target platform, you need to either remove them or replace them with the correct target platform DLLs.
LEADTOOLS Support
General
LEADTOOLS SDK Examples
Could not load or assembly or an attempt was made to load a program with incorrect format
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.