public static class NativeLibrariesResolves the engine's native dependencies itself, instead of leaving it to whatever the binding library does.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
This exists because of a measured failure, not a preference. Silk.NET locates a native library by asking where its own managed assembly is on disk (Assembly.Location) and by reading the dependency manifest (DependencyContext.Default). A NativeAOT application has neither — it is one native binary — so that path cannot work, and nuke CheckAot reports six IL3000 and IL3002 diagnostics saying exactly that. See R11 in docs/plan/15-risks-and-open-questions.md.
What this fixes, and what it does not. A registered resolver runs before the default rules, so the engine's own runtimes/<rid>/native/ layout answers first and the binding library's probing is never reached at run time. It does not silence those diagnostics: ILC's analysis is static, and the unreachable-in-practice code is still reachable in the graph. Suppressing them is a separate, deliberate decision that is only defensible once this is in force — and it is not made here, because a suppression and the thing that justifies it should not arrive in the same breath.
iOS is not this problem. There, everything is statically linked and there is no resolution step to intercept at all; what is needed is the library's symbols at link time. R11 records both halves.
Fields and properties (2)
public static string BaseDirectoryWhere the application's own files are.
public static IReadOnlyDictionary<string, string> ResolvedWhich library each resolved name came from, for logging at boot and for a bug report.
Methods (3)
public static void Describe(NativeLibrarySpec spec)Teaches the resolver about a library.
public static void Register(Assembly assembly)Installs the resolver for an assembly's DllImports.
public static IEnumerable<string> Candidates(string library)Every path that would be tried for a library, in order, without trying any of them.
Used by (6)
- NativeEglApiVixen.Graphics.OpenGL
- NativeResolutionTestsVixen.Platform.Native.Tests
- OpenALLoaderVixen.Audio.Backend.OpenAL
- SdlLibraryVixen.Platform.Desktop
- VulkanLoaderVixen.Graphics.Vulkan
- WebGpuLoaderVixen.Graphics.WebGPU