-
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
Future of dllmap / NativeLibrary? #37084
Comments
First of all, I don't think there is concensus on whether the DllMap support will be re-enabled or not. It may still be useful for AOT compilation where the declarative approach can be evaluated at compile time easily. For CoreCLR there were originally plans to reimplement DllMap on top of NativeLibrary functionality but as far as I know they never materialized. Note that it is possible to combine the loading flexibility of NativeLibrary with the traditional P/Invoke approach. For example, the System.Drawing.Common library does that. |
Ah, good to know!
I'm curious why it wouldn't be re-enabled? CoreCLR I understand since the feature didn't exist in the first place, but for Mono, why remove something that's already implemented and is known to work?
That's a shame, having a built-in compatibility shim seems like a great solution. |
Both the native library loading code and the assembly loading code was substantially reworked to align the behavior with CoreCLR and add support for the new APIs ( |
Duplicate of #37213 that has more in-depth discussion on this topic. |
I work on a game framework that makes use of Mono's dllmap feature for supporting varying native library names across different platforms. I've found the dllmap mechanism to be plenty sufficient for the needs of the project (and far simpler to use than .NET Core's NativeLibrary API), but I'm wondering how future-proof it is.
Since .NET Core 3.0 introduced NativeLibrary, and the Core and Mono runtimes are in the process of being unified for .NET 5+, is dllmap going to be removed from Mono in favor of NativeLibrary? Or will they coexist? Or will NativeLibrary be exclusive to .NET Core?
The text was updated successfully, but these errors were encountered: