Closed ryandanthony closed 2 years ago
is there another way to load a cross platform C++ code in a dotnet standard?
Does DllImport
not suffice? The lib prefix and the file-extension is handled by the runtime depending on the OS (similar as you do manually in the code above).
NativeLibrary
is really handy when -- especially on POSIX systems -- several versions of the library are available and need to be probed, i.e. can't be given as constant in DllImport.
Closing as not planned, as .NET Standard is considered complete.
Are there any plans, or is it even possible, to support NativeLibrary in dotnet standard?
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.nativelibrary?view=netcore-3.1
I have a dotnet standard 2.1 library that needs to load a c++ library, but we want to support multiple versions of the library (linux and windows).
Example usage:
Alternatively, is there another way to load a cross platform C++ code in a dotnet standard?