How to use the correct unmanaged DLL file according CPU architecture? (32 / 64 bits)

后端 未结 3 1661
滥情空心
滥情空心 2020-12-17 01:01

I have to use a C++ DLL file from an ASP.NET site. The site will be hosted on both 32 and 64 bits environments.

I have a 32 and 64 bits version of the unmanaged DLL

3条回答
  •  佛祖请我去吃肉
    2020-12-17 01:08

    Simplest approach would be to give the two native libraries the same filename in two different directories, then adjust your application DLL search path depending on the bitness.

    http://www.pinvoke.net/default.aspx/kernel32.setdlldirectory

提交回复
热议问题