Using VS2010 under windows 32 or 64 bit. Our C# app calls a 3rd party DLL (managed) that interfaces to an unmanaged DLL. The 3rd party DLL API appears identical in 32 or 64 bit although underneath it links to a 32 or 64 bit unmanaged DLL.
We want our C# app to run on either 32 or 64 bit OS, ideally it will auto detect the OS and load the appropriate 32rd party DLL - via a simple factory class which tests the Enviroment. So the neatest solution would be a runtime folder containing: OurApp.exe 3rdParty32.DLL 3rdPartyUnmanaged32.DLL 3rdParty64.DLL 3rdPartyUnmanaged64.DLL
However, the interface for the managed 3rdParty 32 and 64 dll is identical so both cannot be referenced within the same VS2010 project: when adding the second the warning triangle is shown and it does not get referenced.
Is my only answer to create two extra library DLL projects to reference the 3rdParty 32 and 64 Dlls? So I would end up with this project arrangement: Project 1: Builds OurApp.exe, dynamically creates an object for project2 or project3. Project 2: Builds OurApp32.DLL which references 3rdParty32.dll Project 3: Builds OurApp64.DLL which references 3rdParty64.dll
Since you have unmanaged code that is 32 bit or 64 bit specific, you lose the advantage of managed code being able to JIT into either mode at runtime. It might be simplest just to set up your make file to build your application twice, once for 64 bit and once for 32 bit, and use conditional sections in the csproj file to reference the 32 bit or 64 bit unmanaged DLLs. Let the installer install the binaries appropriate to the platform as found at install time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With