Skip to content

Commit

Permalink
Update parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Sep 23, 2024
1 parent 4a6999b commit da35b1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,8 @@ internal static bool TryParse(string runtime, out RuntimeMoniker runtimeMoniker)
int index = runtime.IndexOf('-');

return index < 0
? Enum.TryParse<RuntimeMoniker>(runtime.Replace(".", string.Empty), ignoreCase: true, out runtimeMoniker)
: Enum.TryParse<RuntimeMoniker>(runtime.Substring(0, index).Replace(".", string.Empty), ignoreCase: true, out runtimeMoniker);
? Enum.TryParse<RuntimeMoniker>(runtime.Replace(".", string.Empty).Replace("_", string.Empty), ignoreCase: true, out runtimeMoniker)
: Enum.TryParse<RuntimeMoniker>(runtime.Substring(0, index).Replace(".", string.Empty).Replace("_", string.Empty), ignoreCase: true, out runtimeMoniker);
}
}
}
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet/Environments/Runtimes/ClrRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal static ClrRuntime GetCurrentVersion()
case "4.8": return Net48;
case "4.8.1": return Net481;
default: // unlikely to happen but theoretically possible
return new ClrRuntime(RuntimeMoniker.NotRecognized, $"net{version.Replace(".", null)}", $".NET Framework {version}");
return new ClrRuntime(RuntimeMoniker.NotRecognized, $"net{version.Replace(".", null).Replace("_", null)}", $".NET Framework {version}");
}
}
}
Expand Down

0 comments on commit da35b1c

Please sign in to comment.