From 87c7127c0770e659ddcfc17f6efe7e30cb484756 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 19 Jun 2021 14:45:12 +0200 Subject: [PATCH] debug --- src/CrowEdit.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/CrowEdit.cs b/src/CrowEdit.cs index 734b647..a826bbe 100644 --- a/src/CrowEdit.cs +++ b/src/CrowEdit.cs @@ -1,4 +1,4 @@ -//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.//this is a test of a comment.// Copyright (c) 2013-2020 Jean-Philippe Bruyère +// Copyright (c) 2013-2020 Jean-Philippe Bruyère // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) @@ -7,11 +7,33 @@ using Crow; using System.IO; using System.Collections.Generic; using Crow.Text; +using System.Reflection; +using System.Runtime.InteropServices; namespace CrowEdit { public class CrowEdit : Interface { +#if NETCOREAPP + static IntPtr resolveUnmanaged(Assembly assembly, String libraryName) + { + + switch (libraryName) + { + case "glfw3": + return NativeLibrary.Load("glfw", assembly, null); + case "rsvg-2.40": + return NativeLibrary.Load("rsvg-2", assembly, null); + } + Console.WriteLine($"[UNRESOLVE] {assembly} {libraryName}"); + return IntPtr.Zero; + } + + static CrowEdit() + { + System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()).ResolvingUnmanagedDll += resolveUnmanaged; + } +#endif public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit, CMDShowLeftPane, CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions; -- 2.47.3