diff options
| author | j-p <jp_bruyere@hotmail.com> | 2021-09-28 21:46:05 +0200 |
|---|---|---|
| committer | j-p <jp_bruyere@hotmail.com> | 2021-09-28 21:46:05 +0200 |
| commit | 27af27f77251e50c34ebba110c4ffe74214f7959 (patch) | |
| tree | 4ca7b54294619239a4de34267ccf7c6e9137b50b | |
| parent | 2866fa7335eabc4371cb6909348a8db688c9f59d (diff) | |
netcore cairo resolve dll to cairo-2 on windows
| -rw-r--r-- | Samples/PerfTests/Program.cs | 2 | ||||
| -rw-r--r-- | Samples/common/src/SampleBase.cs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Samples/PerfTests/Program.cs b/Samples/PerfTests/Program.cs index 8ec252dd..222b7e7a 100644 --- a/Samples/PerfTests/Program.cs +++ b/Samples/PerfTests/Program.cs @@ -19,6 +19,8 @@ namespace PerfTests switch (libraryName) { + case "cairo": + return NativeLibrary.Load("cairo-2", assembly, null); case "glfw3": return NativeLibrary.Load("glfw", assembly, null); case "rsvg-2.40": 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) { } |