diff --git a/Source/LibationFileManager/InteropFactory.cs b/Source/LibationFileManager/InteropFactory.cs index ce674ae4..61fae68b 100644 --- a/Source/LibationFileManager/InteropFactory.cs +++ b/Source/LibationFileManager/InteropFactory.cs @@ -39,8 +39,6 @@ namespace LibationFileManager // searches file names for potential matches; doesn't run anything var configApp = getOSConfigApp(); -#if DEBUG - // nothing to load if (configApp is null) { @@ -48,6 +46,9 @@ namespace LibationFileManager return; } +#if DEBUG + + // runs the exe and gets the exe's loaded modules ModuleList = LoadModuleList(Path.GetFileNameWithoutExtension(configApp)) .OrderBy(x => x.ModuleName) @@ -56,7 +57,7 @@ namespace LibationFileManager AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; - var configAppAssembly = Assembly.LoadFrom(Path.ChangeExtension(configApp, "dll")); + var configAppAssembly = Assembly.LoadFrom(configApp); var type = typeof(IInteropFunctions); InteropFunctionsType = configAppAssembly .GetTypes() @@ -121,7 +122,7 @@ namespace LibationFileManager #if DEBUG // `First` instead of `FirstOrDefault`. If it's not present we're going to fail anyway. May as well be here - var modulePath = ModuleList.SingleOrDefault(m => m.ModuleName.EqualsInsensitive(asmName)).FileName; + var modulePath = ModuleList.SingleOrDefault(m => m.ModuleName.EqualsInsensitive(asmName))?.FileName; #else var here = Path.GetDirectoryName(Environment.ProcessPath);