Select highest version of Microsoft.NETCore.App which matches major and minor version of SDK (#19)

This commit is contained in:
Mike Harder 2018-08-29 16:39:39 -07:00 committed by GitHub
parent 8e3d1f9e33
commit 777af897a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -59,7 +59,9 @@ namespace Cli.FunctionalTests.Util
var sdkVersionString = Regex.Match(info, @"Version:\s*(\S+)").Groups[1].Value;
var sdkVersion = SemanticVersion.Parse(sdkVersionString);
var runtimeVersionString = Regex.Match(info, @"Microsoft.NETCore.App\s*(\S+)").Groups[1].Value;
// Select highest version of Microsoft.NETCore.App which matches major and minor version of SDK
var runtimeVersionPattern = $@"Microsoft.NETCore.App\s*({sdkVersion.Major}.{sdkVersion.Minor}\S+)";
var runtimeVersionString = Regex.Match(info, runtimeVersionPattern, RegexOptions.RightToLeft).Groups[1].Value;
var runtimeVersion = SemanticVersion.Parse(runtimeVersionString);
// Supported version range is [2.1.300,2.2.100] (inclusive)