Is there a way that the specific DLL referenced by the P / Invoke (DllImport) signature depends on the CPU architecture?
I am working on an application that downloads a large number of method signatures from a native dll from a third-party provider, in this case the user-space interface DLL to the piece of hardware. This provider has now begun shipping both the x86 and x64 versions of the DLL now, and I think my application will benefit from running as a 64-bit process. With the exception of this DLL, this is all .NET code, so working on "Any CPU" will work.
All method signatures in the native DLL are the same on the 64-bit one, however the DLL name is different (Foo.dll vs. Foo_x64.dll). Is there any way through the P / Invoke or app.config signatures, I can get it to choose which DLL to load based on the current processor architecture?
If instead of different DLL names it was the same name in different folders, does it open any other parameters?
Note. Since it is important that the version of this DLL for the user matches the installed kernel driver for the hardware, the DLL does not come with our application, but instead we depend on the provider installer to put it in the% PATH% directory.
Cheetah Oct. 15 '09 at 17:01 2009-10-15 17:01
source share