From 79b355e6ffe71ac43b9c052549351815b1627fe7 Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Wed, 29 Mar 2017 18:53:00 +0900 Subject: [PATCH] Replace the unmanaged name of native module with the library path Change-Id: I9e3ec63c9f485c02a97af0d8104c5384c32c0452 --- Tizen.Runtime/Tizen.Runtime.Coreclr/AssemblyLoader.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tizen.Runtime/Tizen.Runtime.Coreclr/AssemblyLoader.cs b/Tizen.Runtime/Tizen.Runtime.Coreclr/AssemblyLoader.cs index 3423d80..dd96abf 100755 --- a/Tizen.Runtime/Tizen.Runtime.Coreclr/AssemblyLoader.cs +++ b/Tizen.Runtime/Tizen.Runtime.Coreclr/AssemblyLoader.cs @@ -40,6 +40,12 @@ namespace Tizen.Runtime.Coreclr private HashSet _assemblyCache = new HashSet(); + private Dictionary _unmanagedDictionary = new Dictionary() + { + {"sqlite3", "/lib/libsqlite3.so.0"}, + {"libsqlite3.so", "/lib/libsqlite3.so.0"} + }; + public AssemblyLoader() { AssemblyLoadContext.Default.Resolving += OnResolving; @@ -106,6 +112,18 @@ namespace Tizen.Runtime.Coreclr protected override IntPtr LoadUnmanagedDll(string unmanagedDllName) { + if (_unmanagedDictionary.ContainsKey(unmanagedDllName)) + { + if (File.Exists(_unmanagedDictionary[unmanagedDllName])) + { + unmanagedDllName = _unmanagedDictionary[unmanagedDllName]; + } + else + { + unmanagedDllName = _unmanagedDictionary[unmanagedDllName].Replace("/lib/", "/lib64/"); + } + } + IntPtr native = base.LoadUnmanagedDll(unmanagedDllName); if (native == IntPtr.Zero) { -- 2.7.4