-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Versioning and loading libraries #4032
Comments
FWIW, that's already a common grief for users of aspnet/KestrelHttpServer on Linux, so it would be great if this becomes a general solution that is available for all packages outside. Usually, you use something like Mono uses |
As @Tragetaschen said, this is a common problem and Mono's solution to this is dllmap as described here. While browsing the net, I found that Julia also has an interesting approach: they provide an api that internally reads the output of
... which means one can just call the wrapper function with the "simple" module name and get back the proper name incl. version. |
The Julia approach seems particularly nice, I've never liked having to ship dllmaps, they're a pain and confusing for users. |
I also agree that dllMaps are ugly, but it would be good to have a general solution for per-platform library names. Adding to Kestrel user's grief: trying to get Microsoft.Data.Sqlite to load native sqlite calls is pain because DllImportAttribute requires a constant library name. On Windows it's "sqlite3" and OS X and *nix it's "libsqlite3". |
Please, please, please build on all the great work of Mono. |
Closing this issue, the matter is tracked by dotnet/corefx#32015. |
As discussed in dotnet/coreclr#441, we are currently brittle with regards to our usage of dlopen, which requires that we provide the name of a library that includes version information. We need to figure out how we want to handle this, for the specific case discussed in dotnet/coreclr#441, for DllImports in general, and for anywhere else we may rely on loading arbitrary libraries.
The text was updated successfully, but these errors were encountered: