Import external dll based on 64bit or 32bit OS

Posted by Mike_G on Stack Overflow See other posts from Stack Overflow or by Mike_G
Published on 2010-04-07T15:53:56Z Indexed on 2010/04/07 16:03 UTC
Read the original article Hit count: 139

Filed under:
|
|
|

I have a dll that comes in both 32bit and 64bit version. My .NET WinForm is configured for "Any CPU" and my boss will not let us have separate installs for the different OS versions. So I am wondering: if I package both dlls in the install, then is there a way to have the WinForm determine if its 64bit/32bit and load the proper dll.

I found this article for determining version. But i am not sure how to inject the proper way to define the DLLImport attribute on the methods i wish to use. Any ideas?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET