diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-11-19 09:12:12 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-11-19 09:12:12 +0100 |
| commit | a77e1d7b06d860e040097b72cb9244a45e634e62 (patch) | |
| tree | 9dd6aa8227230ef0d8fcdf0e231d79cc5d3655a3 /Samples/common/SampleBase.cs | |
| parent | 060b89f24df61f71f281989ce81368dbefb47886 (diff) | |
save commit
Diffstat (limited to 'Samples/common/SampleBase.cs')
| -rw-r--r-- | Samples/common/SampleBase.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Samples/common/SampleBase.cs b/Samples/common/SampleBase.cs index 93aec907..65345be7 100644 --- a/Samples/common/SampleBase.cs +++ b/Samples/common/SampleBase.cs @@ -1,4 +1,6 @@ -using System; +using System.Net.NetworkInformation; +using System.Runtime.InteropServices; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -10,6 +12,24 @@ using Crow; namespace Crow { public class SampleBase : 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 SampleBase () { + System.Runtime.Loader.AssemblyLoadContext.Default.ResolvingUnmanagedDll+=resolveUnmanaged; + } +#endif public Version CrowVersion => Assembly.GetAssembly (typeof (Widget)).GetName ().Version; #region Test values for Binding |