Skip to content

Commit

Permalink
Changed Mono version checker from direct call to reflection
Browse files Browse the repository at this point in the history
- Changed Mono version checker from direct call to reflection to ironically fix it not working on older Mono versions
  • Loading branch information
Dankrushen committed Jun 14, 2019
1 parent 0cef724 commit 5389c06
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions MultiAdmin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using MultiAdmin.Config;
using MultiAdmin.ConsoleTools;
Expand Down Expand Up @@ -407,12 +406,8 @@ public static void CheckMonoVersion()
{
try
{
if (!RuntimeInformation.FrameworkDescription.StartsWith("Mono"))
{
return;
}

string monoVersion = RuntimeInformation.FrameworkDescription?.Split(' ').FirstOrDefault(IsVersionFormat);
string monoVersionRaw = Type.GetType("Mono.Runtime")?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static)?.Invoke(null, null)?.ToString();
string monoVersion = monoVersionRaw?.Split(' ').FirstOrDefault(IsVersionFormat);

if (string.IsNullOrEmpty(monoVersion))
return;
Expand Down

0 comments on commit 5389c06

Please sign in to comment.