Skip to content

Fix issue using pre-release version of NET Core SDK #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, TestP
}

# Make sure the dotnet we found is the right version
if ($dotnetExePath -and [version](& $dotnetExePath --version) -ge [version]$requiredSdkVersion) {
$script:dotnetExe = $dotnetExePath
if ($dotnetExePath) {
# dotnet --version can return a semver that System.Version can't handle
# e.g.: 2.1.300-preview-01. The replace operator is used to remove any build suffix.
$version = (& $dotnetExePath --version) -replace '[+-].*$',''
if ([version]$version -ge [version]$requiredSdkVersion) {
$script:dotnetExe = $dotnetExePath
}
else {
# Clear the path so that we invoke installation
$script:dotnetExe = $null
}
}
else {
# Clear the path so that we invoke installation
Expand Down