简体   繁体   中英

Consuming 64bit dll in 32 bit OS

Currently I have one app written in C#. Internally I am consuming another 3rd party dll, which is also written in C# and compiled in 32 bit Windows. The 3rd party dll is going to be released in 64 bit windows and eventually I have to consume this new dll. But I don't want to migrate to 64 bit OS as of now.

My question: Will this new dll impact my existing code? If yes, then how and what changes I need to carry out to accommodate this feature.

I'm pretty certain that you can't use 64-bit DLLs in 32-bit Windows.

You can go the other way by using tricks like thunking or 32-bit subsystems like WoW64, but you don't have all the support for 64-bit code in the 32-bit version..

Hopefully your third party will continue to provide a 32-bit version of their DLL so you don't have to worry about it. If not, and you want to upgrade, you're going to need to go 64-bit as well.

If the third party library is a C# library, it should be compiled as AnyCPU. (Check with the authors to be sure.)

If it is compiled as AnyCPU, then if you use it from a 32-bit program it will operate as 32-bits, and if you use it from a 64-bit program it will operate as 64 bits.

Otherwise, you will need to change your own program to match the DLL. But if they aren't setting it to AnyCPU, I'd complain to them... or find out what their motivation is (maybe it's using unmanaged DLLs).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM