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

后端 未结 5 1470
北恋
北恋 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:05

    Using AnyCPU with native early bindings is just not going to work, for that you need two separate solutions and builds as you saw. You have to get hold of a 64-bit system to develop or at least test x64 compiled dlls on.

    However, with late binding, you can use AnyCPU and System properties to figure out what architecture you're running as and link to the correct dll, if you keep the named like Oracle.DataAccess.x86.dll. If they're installed into the GAC, it's even easier, you can bind without even bothering to test for architecture first, but I believe you still have to late bind.

    Note that VMware can run a 64-bit guest on a 32-bit host, if you really can't be bothered to reinstall Windows.

提交回复
热议问题