Initialize HarmonyXInterop later

This commit is contained in:
ghorsington committed 2020-10-19 13:31:40 +03:00
1 parent 9cce4e4222
commit bb787623a4
1 file changed
+2 -2
+2 -2
View File
@@ -14,16 +14,15 @@ namespace BepInEx.Preloader
string bepinPath = Utility.ParentDirectory(Path.GetFullPath(EnvVars.DOORSTOP_INVOKE_DLL_PATH), 2);
Paths.SetExecutablePath(EnvVars.DOORSTOP_PROCESS_PATH, bepinPath, EnvVars.DOORSTOP_MANAGED_FOLDER_DIR);
HarmonyInterop.Initialize();
AppDomain.CurrentDomain.AssemblyResolve += LocalResolve;
// Remove temporary resolver early so it won't override local resolver
AppDomain.CurrentDomain.AssemblyResolve -= Entrypoint.ResolveCurrentDirectory;
PreloaderMain();
}
private static void PreloaderMain()
{
HarmonyInterop.Initialize();
if (Preloader.ConfigApplyRuntimePatches.Value)
{
XTermFix.Apply();
@@ -106,6 +105,7 @@ namespace BepInEx.Preloader
internal static Assembly ResolveCurrentDirectory(object sender, ResolveEventArgs args)
{
File.AppendAllText("resolve_early.log", $"Resolving {args.Name}\n");
// Can't use Utils here because it's not yet resolved
var name = new AssemblyName(args.Name);