ship harmony with torch to prevent crashes due to runtime version mismatch

add warning if plugin is using harmony
update monomod package
This commit is contained in:
zznty
2022-05-08 12:26:31 +07:00
parent d05e979ede
commit 5fe25fb781
2 changed files with 9 additions and 1 deletions

View File

@@ -384,6 +384,13 @@ namespace Torch.Managers
}
var harmonyAssembly = assemblies.FirstOrDefault(b => b.FullName?.StartsWith("0Harmony") == true);
if (harmonyAssembly is { })
{
_log.Warn($"Plugin {item.Manifest.Name} is using harmony library, logic collision between plugins could be encountered!");
assemblies.Remove(harmonyAssembly);
}
RegisterAllAssemblies(assemblies);
InstantiatePlugin(item.Manifest, assemblies);
}

View File

@@ -20,9 +20,10 @@
<!-- <Import Project="$(SolutionDir)\TransformOnBuild.targets" /> -->
<ItemGroup>
<PackageReference Include="ControlzEx" Version="5.0.1" />
<PackageReference Include="HarmonyX" Version="2.10.0" />
<PackageReference Include="InfoOf.Fody" Version="2.1.0" PrivateAssets="all" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="22.1.4.3" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="22.5.1.1" />
<PackageReference Include="NLog" Version="5.0.0-rc2" />
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" PrivateAssets="all" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />