diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index aac58453ce..cd096ea1d9 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -1267,7 +1267,8 @@ namespace BizHawk.Client.EmuHawk { try { - externalToolFile = Assembly.ReflectionOnlyLoadFrom(fi.FullName); + //externalToolFile = Assembly.ReflectionOnlyLoadFrom(fi.FullName); + externalToolFile = Assembly.LoadFrom(fi.FullName); } catch (BadImageFormatException) { @@ -1286,10 +1287,12 @@ namespace BizHawk.Client.EmuHawk existing in another assembly, it raises the exception. But the advantage of this is that memory footprint is reduced + + EDIT: In fact, I have some trouble when loading Reflection only... moved to regular load */ try { - assemblyTypes = externalToolFile.GetTypes(); + assemblyTypes = externalToolFile.GetTypes().Where(t => t != null && t.FullName == "BizHawk.Client.EmuHawk.CustomMainForm").ToArray(); } catch (ReflectionTypeLoadException ex) { diff --git a/BizHawk.Client.EmuHawk/tools/ToolManager.cs b/BizHawk.Client.EmuHawk/tools/ToolManager.cs index 36b22a5379..626182c719 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolManager.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolManager.cs @@ -91,7 +91,7 @@ namespace BizHawk.Client.EmuHawk T existingTool = (T)_tools.FirstOrDefault(x => x is T); - if (existingTool != null) + if (existingTool != null && typeof(T) != typeof(IExternalToolForm)) { if (existingTool.IsDisposed) {