diff --git a/src/code/InstallHelper.cs b/src/code/InstallHelper.cs index cd86fe180..9057eda10 100644 --- a/src/code/InstallHelper.cs +++ b/src/code/InstallHelper.cs @@ -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)