From 60e1905e355a89c534ad236fb711047c91c79e5e Mon Sep 17 00:00:00 2001 From: ghorsington Date: Sat, 3 Oct 2020 18:43:49 +0300 Subject: [PATCH] AccessTools: Don't call TypeByName for full type to not trigger assembly resolving --- Harmony/Tools/AccessTools.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Harmony/Tools/AccessTools.cs b/Harmony/Tools/AccessTools.cs index d02976f9..4f4fed3d 100644 --- a/Harmony/Tools/AccessTools.cs +++ b/Harmony/Tools/AccessTools.cs @@ -1552,13 +1552,13 @@ public static void RethrowException(Exception exception) /// True if the current runtime is .NET Framework, false otherwise (.NET Core or Mono, although latter isn't guaranteed) /// public static bool IsNetFrameworkRuntime { get; } = - TypeByName("System.Runtime.InteropServices.RuntimeInformation")?.GetProperty("FrameworkDescription") + Type.GetType("System.Runtime.InteropServices.RuntimeInformation", false)?.GetProperty("FrameworkDescription") .GetValue(null, null).ToString().StartsWith(".NET Framework") ?? IsMonoRuntime is false; /// True if the current runtime is .NET Core, false otherwise (Mono or .NET Framework) /// public static bool IsNetCoreRuntime { get; } = - TypeByName("System.Runtime.InteropServices.RuntimeInformation")?.GetProperty("FrameworkDescription") + Type.GetType("System.Runtime.InteropServices.RuntimeInformation", false)?.GetProperty("FrameworkDescription") .GetValue(null, null).ToString().StartsWith(".NET Core") ?? false; /// Throws a missing member runtime exception