Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Dear Friends

My Main application is 32-bit application. It is limitation due to some third party DLLs that I can't convert it to 64-bit.
Now I have created a new 64-bit library project and compilation is successful but on application startup it gives error.

What I have tried:

Trying to Run but failed.
Error: Could not load file or Assembly My64Project Version=1.0.0.0, culture=neutral, publicToken=null or one of its dependencies. An Attempt was made to load a program with an incorrect format.
Posted
Updated 18-Nov-20 3:35am

Please have a look here:
Process Interoperability - Win32 apps | Microsoft Docs[^]
There it is said:
On 64-bit Windows, a 64-bit process cannot load a 32-bit dynamic-link library (DLL). Additionally, a 32-bit process cannot load a 64-bit DLL. 

Switch your application to 64bit and get 64bit versions of the third party dlls
or stay at 32 bit and create a 32 bit library project.
 
Share this answer
 
You can't load a 64-bit library in a 32-bit process, or a 32-bit library in a 64-bit process.
 
Share this answer
 
Here is a possible solution: How do I use 32-bit dll in 64-bit app?[^]
But it does not look very robust to me, another option might be to split your application in a 32 part (with all the legacy dll's) and a 64 bit part and let them communicate via named pipes or something like that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900