0

In my web app I have to refer two third party assemblies, one is compiled for x86 and other is for x64. Both dlls are with same name and version.

For example:

Foo.dll  --x86, used to get data from x86 machines
Foo.dll  --x64, used to get data from x64 machines.

I have to refer these two dlls in web app. In my web app all other dlls are compiled with 'any CPU' option because my web app can be installed in any machine(x86 or x64).

In my web app if user tells to get data from ServerA (x86 machine) then my web app has to refer Foo.dll(x86) version to get data from x86 machines. if user tells to get data from ServerB (x64 machine) then my web app has to refer Foo.dll(x64) version to get data from x64 machines.

What is the best approach to address this issue?

I am working with VS2010. .NET 3.5

PSR
  • 875
  • 2
  • 13
  • 37
  • 2
    Just to ensure we have all the information; Is it the code inside that is different in order to cope with x64/x86 machines, or are the dll's compiled for x86/x64? In other words, the instructions inside, are they compiled for x64/x86, or is the C# written code actually different, things like structure content or what not. Also, I assume that the web server will *talk* to these machines, and not *run the code on* these machines? – Lasse V. Karlsen Mar 28 '13 at 11:12
  • @LasseV.Karlsen code in both dlls are different. In my web app user can specify any server name to get data. User wont have direct access to those servers. – PSR Mar 28 '13 at 11:24
  • But those dll's are still compiled as "any cpu", right? – Lasse V. Karlsen Mar 28 '13 at 11:26
  • @LasseV.Karlsen, seems like there is some confusion. In my web app I am referecing 6 other dlls and all of those are compiled as 'any cpu'. The extra thrid party dlls ( here, Foo.dll) is compiled in x86 and x64 platforms seperately. Hope now it is clear. – PSR Mar 28 '13 at 12:32
  • Then you will need an extra process to load those into, a 32-bit process cannot load a x64 assembly, and vice versa. You will need to spin up an extra process, 32-bit or 64-bit correspondingly, and communicate with it. – Lasse V. Karlsen Mar 28 '13 at 13:56
  • possible duplicate http://stackoverflow.com/questions/7264383/options-for-using-system-data-sqlite-in-a-32bit-and-64bit-c-sharp-world – Sheng Jiang 蒋晟 Mar 28 '13 at 14:29

0 Answers0