Trying to not need two separate solutions for x86 and x64 program

后端 未结 5 1512
北恋
北恋 2021-01-02 15:45

I have a program which needs to function in both an x86 and an x64 environment. It is using Oracle\'s ODBC drivers. I have a reference to Oracle.DataAccess.DLL. This DLL is

5条回答
  •  悲哀的现实
    2021-01-02 16:16

    If you're running on a 32-bit machine, then you have to load the 32-bit version of the Oracle DLL. A 32-bit program can't reference a 64-bit DLL. And, a 64-bit program can't reference a 32-bit DLL.

    "Any CPU" is the correct target if you have multiple versions of the external DLL. The trick is making sure that the proper Oracle DLL is located and loaded. Your best bet is to locate the 64-bit version of the DLL on your 32-bit system and rename it so that the runtime can't find it.

提交回复
热议问题