简体   繁体   中英

Using 32 bit library from 64 bit project - .NET

Our application is all 64 bit. We got ADODB provider to 3rd party database (nexusdb). It's 32 bit and consists of .NET library (which we reference just fine) and I beleive C .dll which is 32 bit. So, when we compile in 32 bit it works, in 64 it complains that it can't find C .dll.

How can we solve this issue without compiling our code to 32 bit?

EDIT:

3rd party DLL's as follow: ADONET.dll - this is .NET native DLL that I reference and it references just fine. ADONETProvider.dll - this is non-.NET 32 bit DLL that I just keep in bin/ folder.

I DO NOT want to compile my project for x86 because I reference many other projects and they all 64.

I want to make sure that ADONET.dll somehow called in "32 bit mode"

You have to use some kind of surrogate process and IPC to access a 32 bit dll from a 64bit process.

Some time ago I wrote the LegacyWrapper project that hides this behind a simple API call. You may want to see the corresponding blog post for technical details.

Edit: Since Version 2.1, LegacyWrapper also supports loading 64bit DLLs from a 32bit process.

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