clrzmq icon indicating copy to clipboard operation
clrzmq copied to clipboard

Nuget package for both x32 and x64

Open BrannonKing opened this issue 10 years ago • 0 comments

It's possible to choose the native DLL that is loaded at runtime. That allows us to have a single Nuget package that includes both x86 and x64 support. Once the native DLL is loaded, all DllImport items use that one. This also allows the nice "Any CPU" support. You can see how this is done with Sqlite (on Windows):

[DllImport("kernel32", SetLastError = true)] public static extern IntPtr LoadLibrary(string lpFileName);

static MyClassThatUsesTheNativeLibrary() { LoadLibrary(Path.Combine(IntPtr.Size > 4 ? "x64" : "x32", "Sqlite.Interop.dll")); }

BrannonKing avatar Jan 14 '14 16:01 BrannonKing