From: CORP\mobaswirul.i Date: Thu, 3 Oct 2024 09:57:07 +0000 (+0600) Subject: Fix defects detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20241006.053311^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_toolchain;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsettings.git Fix defects detected by static analysis tool [Problem] [TNINE-4742] Issues detected by Static Analysis Tool [Cause & Measure] Cause : Assembly was not loaded properly. Measure : Loaded Assembly File Properly. Change-Id: Icbe46b55db00741ddbc8728937ca72767454afac Signed-off-by: CORP\mobaswirul.i --- diff --git a/SettingCore/GadgetProvider.cs b/SettingCore/GadgetProvider.cs index 78789cf..acf514e 100644 --- a/SettingCore/GadgetProvider.cs +++ b/SettingCore/GadgetProvider.cs @@ -64,12 +64,11 @@ namespace SettingCore private static IEnumerable getSettingGadgetInfos(NUIGadgetInfo gadgetInfo) { string assemblyPath = System.IO.Path.Combine(gadgetInfo.ResourcePath, gadgetInfo.ExecutableFile); - byte[] fileData = System.IO.File.ReadAllBytes(assemblyPath); Assembly assembly = null; try { Logger.Verbose($"Opening assembly from {assemblyPath} ({gadgetInfo.ResourcePath}, {gadgetInfo.ExecutableFile})"); - assembly = System.Reflection.Assembly.Load(fileData); + assembly = Assembly.Load(AssemblyName.GetAssemblyName(assemblyPath)); } catch (System.IO.FileLoadException) { diff --git a/packaging/org.tizen.cssettings-1.2.4.tpk b/packaging/org.tizen.cssettings-1.2.4.tpk index bc1bb8f..2160e30 100644 Binary files a/packaging/org.tizen.cssettings-1.2.4.tpk and b/packaging/org.tizen.cssettings-1.2.4.tpk differ