From 0b6ff007c708c7ae3fda3c6d6fc76f48e7bd4484 Mon Sep 17 00:00:00 2001 From: Chris Dill Date: Fri, 28 Aug 2026 07:45:14 +0100 Subject: [PATCH] Make the custom dll import resolver optional --- Raylib-cs/interop/Raylib.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs index c7ca8f9..78d492f 100644 --- a/Raylib-cs/interop/Raylib.cs +++ b/Raylib-cs/interop/Raylib.cs @@ -24,18 +24,6 @@ public static unsafe partial class Raylib public const float DEG2RAD = MathF.PI / 180.0f; public const float RAD2DEG = 180.0f / MathF.PI; - static Raylib() - { - // On WebAssembly (browser) the native library is statically linked into the main - // module, and P/Invokes are resolved by the runtime's built-in static-linking table. - // A custom resolver would override that and fail (there is no library to load), so we - // only install it on platforms where raylib is a separate dynamic library. - if (!OperatingSystem.IsBrowser()) - { - NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), ResolveDllImport); - } - } - public static IntPtr ResolveDllImport(string libraryName, Assembly assembly, DllImportSearchPath? searchPath) { IntPtr handle = IntPtr.Zero;