You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
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"));
}
The text was updated successfully, but these errors were encountered: