AdvancedDLSupport icon indicating copy to clipboard operation
AdvancedDLSupport copied to clipboard

Add support for NuGet package cache loading.

Open Perksey opened this issue 5 years ago • 2 comments

Is your feature request related to a problem? Please describe. Recently, when trying to distribute a package containing native packages with the intention of invoking them using ADL, I noticed that ADL would not find the library on a non-RID-specific build but DllImport can.

I then found out that DllImport also checks the NuGet cache for native assemblies, but ADL doesn't.

Describe the solution you'd like We need to investigate the best way to search across multiple paths similar to CoreFX. This could be done internally, or we could expose an API similar to .NET Core 3's new NativeLibrary API and use DllImportSearchPaths.

Either way, we need to find out what paths we need to be looking in and then we can go from there.

Additional context

  • CoreFX doesn't copy native libraries unless you build with a RID specified.

Perksey avatar Sep 21 '19 14:09 Perksey

A bit unrelated comment, but you have a typo here in .NET Core section: ManagedByRef should be ManagedByValue, it seems that it's just a copy of the actual ManagedByRef.

nxrighthere avatar Mar 19 '20 10:03 nxrighthere

That deserves its own issue/PR I think.

Perksey avatar Mar 19 '20 12:03 Perksey