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