Skip to content

Commit da35b1c

Browse files
committed
Update parsing
1 parent 4a6999b commit da35b1c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/BenchmarkDotNet/ConsoleArguments/ConfigParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,8 @@ internal static bool TryParse(string runtime, out RuntimeMoniker runtimeMoniker)
776776
int index = runtime.IndexOf('-');
777777

778778
return index < 0
779-
? Enum.TryParse<RuntimeMoniker>(runtime.Replace(".", string.Empty), ignoreCase: true, out runtimeMoniker)
780-
: Enum.TryParse<RuntimeMoniker>(runtime.Substring(0, index).Replace(".", string.Empty), ignoreCase: true, out runtimeMoniker);
779+
? Enum.TryParse<RuntimeMoniker>(runtime.Replace(".", string.Empty).Replace("_", string.Empty), ignoreCase: true, out runtimeMoniker)
780+
: Enum.TryParse<RuntimeMoniker>(runtime.Substring(0, index).Replace(".", string.Empty).Replace("_", string.Empty), ignoreCase: true, out runtimeMoniker);
781781
}
782782
}
783783
}

src/BenchmarkDotNet/Environments/Runtimes/ClrRuntime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal static ClrRuntime GetCurrentVersion()
6666
case "4.8": return Net48;
6767
case "4.8.1": return Net481;
6868
default: // unlikely to happen but theoretically possible
69-
return new ClrRuntime(RuntimeMoniker.NotRecognized, $"net{version.Replace(".", null)}", $".NET Framework {version}");
69+
return new ClrRuntime(RuntimeMoniker.NotRecognized, $"net{version.Replace(".", null).Replace("_", null)}", $".NET Framework {version}");
7070
}
7171
}
7272
}

0 commit comments

Comments
 (0)