-
Notifications
You must be signed in to change notification settings - Fork 24
Adopt new API in .NET Core 3.0 - System.Runtime.InteropServices.NativeLibrary #13
Copy link
Copy link
Open
Description
I've encountered similar issue as #2. Since that time, native API has been merged in the .NET Core 3.0, see docs.
The library may adopt these changes quite easy:
class NetCoreLibraryLoader : LibraryLoader
{
protected override void CoreFreeNativeLibrary(IntPtr handle)
{
System.Runtime.InteropServices.NativeLibrary.Free(handle);
}
protected override IntPtr CoreLoadFunctionPointer(IntPtr handle, string functionName)
{
return System.Runtime.InteropServices.NativeLibrary.GetExport(handle, functionName);
}
protected override IntPtr CoreLoadNativeLibrary(string name)
{
return System.Runtime.InteropServices.NativeLibrary.Load(name);
}
}We would have to target .NET Core 3.0 instead of .NET Standard 2.0.
What is your opinion about changing/adding the target framework to Core 3.0? Or maybe publish both NS and Core versions? Not sure whether it works - from the consumer perspective. I've seen a few libraries dropped out NS support and target Core but I'm aware that this library is commonly used in Mono/Xamarin.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels