From 27af27f77251e50c34ebba110c4ffe74214f7959 Mon Sep 17 00:00:00 2001 From: j-p Date: Tue, 28 Sep 2021 21:46:05 +0200 Subject: netcore cairo resolve dll to cairo-2 on windows --- Samples/common/src/SampleBase.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Samples/common/src/SampleBase.cs') diff --git a/Samples/common/src/SampleBase.cs b/Samples/common/src/SampleBase.cs index 3e0ef714..eee98f9a 100644 --- a/Samples/common/src/SampleBase.cs +++ b/Samples/common/src/SampleBase.cs @@ -22,6 +22,8 @@ namespace Samples switch (libraryName) { + case "cairo": + return NativeLibrary.Load("cairo-2", assembly, null); case "glfw3": return NativeLibrary.Load("glfw", assembly, null); case "rsvg-2.40": @@ -30,10 +32,11 @@ namespace Samples Console.WriteLine($"[UNRESOLVE] {assembly} {libraryName}"); return IntPtr.Zero; } - static SampleBase() { - System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()).ResolvingUnmanagedDll += resolveUnmanaged; + System.Runtime.Loader.AssemblyLoadContext ctx = + System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()); + ctx.ResolvingUnmanagedDll += resolveUnmanaged; } #endif public SampleBase(IntPtr hWin) : base(800, 600, hWin) { } -- cgit v1.3.1-4-g156e