diff --git a/TreeConverter/NetWrappers/NetHelper.cs b/TreeConverter/NetWrappers/NetHelper.cs index 10203f76a..867085cf3 100644 --- a/TreeConverter/NetWrappers/NetHelper.cs +++ b/TreeConverter/NetWrappers/NetHelper.cs @@ -360,7 +360,7 @@ namespace PascalABCCompiler.NetHelper return false; } - public static Assembly LoadAssembly(string name) + public static Assembly LoadAssembly(string name, bool use_load_from = false) { if (name == null) return null; Assembly a = ass_name_cache[name] as Assembly; @@ -415,8 +415,10 @@ namespace PascalABCCompiler.NetHelper fs.Read(buf, 0, (int)fs.Length); fs.Close(); curr_inited_assm_path = name; - a = System.Reflection.Assembly.Load(buf); - + if (!use_load_from) + a = System.Reflection.Assembly.Load(buf); + else + a = System.Reflection.Assembly.LoadFrom(name); a.GetTypes(); buf = null; //Thread th = new Thread(new ThreadStart(collect_internal)); @@ -944,7 +946,7 @@ namespace PascalABCCompiler.NetHelper if (!System.IO.File.Exists(path)) path = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), args.Name.Substring(0, args.Name.IndexOf(",")) + ".dll"); if (System.IO.File.Exists(path)) - assm = LoadAssembly(path); + assm = LoadAssembly(path, true); curr_inited_assm_path = null; //return LoadAssembly(args.Name);