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

Posted by Sean Anderson on Stack Overflow See other posts from Stack Overflow or by Sean Anderson
Published on 2011-01-05T00:20:54Z Indexed on 2011/01/05 0:53 UTC
Read the original article Hit count: 260

Filed under:
|
|

Hi all,

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 different depending on whether the system is x64 or x86, though.

Currently, I have two separate solutions and I am maintaining the code on both. This is atrocious. I was wondering what the proper solution is?

I have my platform set to "Any CPU." and it is my understanding that VS should compile the DLL to an intermediary language such that it should not matter if I use the x86 or x64 version. Yet, if I attempt to use the x64 DLL I receive the error "Could not load file or assembly 'Oracle.DataAccess, Version=2.102.3.2, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format."

I am running on a 32 bit machine, so the error message makes sense, but it leaves me wondering how I am supposed to efficiently develop this program when it needs to work on x64.

Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio-2008