From ddc59c9d7eeff4c018324129200b821ca673dde3 Mon Sep 17 00:00:00 2001 From: hjhun <36876573+hjhun@users.noreply.github.com> Date: Fri, 26 Jan 2024 09:12:33 +0900 Subject: [PATCH] [NUI.Gadget] Change assembly load mothod (#5913) - Use LoadFromNativeImagePath() instead of LoadFromStream() Signed-off-by: Hwankyu Jhun --- src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs index 9cfb199..b5dd7e0 100644 --- a/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs +++ b/src/Tizen.NUI.Gadget/Tizen.NUI/NUIGadgetAssembly.cs @@ -19,6 +19,8 @@ using System.IO; using System.Reflection; using System.Runtime.Loader; +using SystemIO = System.IO; + namespace Tizen.NUI { internal class NUIGadgetAssemblyLoadContext : AssemblyLoadContext @@ -54,10 +56,11 @@ namespace Tizen.NUI Log.Warn("Load(): " + _assemblyPath + " ++"); NUIGadgetAssemblyLoadContext context = new NUIGadgetAssemblyLoadContext(); _assemblyRef = new WeakReference(context); - using (MemoryStream memoryStream = new MemoryStream(File.ReadAllBytes(_assemblyPath))) - { - _assembly = context.LoadFromStream(memoryStream); - } + string directoryPath = SystemIO.Path.GetDirectoryName(_assemblyPath); + string fileName = SystemIO.Path.GetFileNameWithoutExtension(_assemblyPath); + string nativeImagePath = directoryPath + "/" + fileName + ".ni.dll"; + Log.Debug("NativeImagePath=" + nativeImagePath + ", AssemblyPath=" + _assemblyPath); + _assembly = context.LoadFromNativeImagePath(nativeImagePath, _assemblyPath); Log.Warn("Load(): " + _assemblyPath + " --"); } } -- 2.7.4