Skip to content
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

Add prerelease string when NormalizedVersion doesn't exist (but prelease string does) #1681

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
5 changes: 5 additions & 0 deletions src/code/InstallHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,12 @@ private Hashtable BeginPackageInstall(
pkgToInstall.RepositorySourceLocation = repository.Uri.ToString();
pkgToInstall.AdditionalMetadata.TryGetValue("NormalizedVersion", out string pkgVersion);
if (pkgVersion == null) {
// Not all NuGet providers (e.g. Artifactory, possibly others) send NormalizedVersion in NuGet package responses.
// If they don't, we need to manually construct the combined version+prerelease from pkgToInstall.Version and the prerelease string.
pkgVersion = pkgToInstall.Version.ToString();
if (!String.IsNullOrEmpty(pkgToInstall.Prerelease)) {
pkgVersion += $"-{pkgToInstall.Prerelease}";
}
}
// Check to see if the pkg is already installed (ie the pkg is installed and the version satisfies the version range provided via param)
if (!_reinstall)
Expand Down
Loading