@@ -37,6 +37,7 @@ internal abstract class InstallingWorkloadCommand : WorkloadCommandBase
37
37
protected readonly string _userProfileDir ;
38
38
protected readonly bool _checkIfManifestExist ;
39
39
protected readonly ReleaseVersion _sdkVersion ;
40
+ protected readonly ReleaseVersion _installedSdkVersion ;
40
41
protected readonly SdkFeatureBand _sdkFeatureBand ;
41
42
protected readonly SdkFeatureBand _installedFeatureBand ;
42
43
protected readonly string _fromRollbackDefinition ;
@@ -70,17 +71,17 @@ public InstallingWorkloadCommand(
70
71
_checkIfManifestExist = ! ( _printDownloadLinkOnly ) ; // don't check for manifest existence when print download link is passed
71
72
_sdkVersion = WorkloadOptionsExtensions . GetValidatedSdkVersion ( parseResult . GetValueForOption ( InstallingWorkloadCommandParser . VersionOption ) , version , _dotnetPath , _userProfileDir , _checkIfManifestExist ) ;
72
73
_sdkFeatureBand = new SdkFeatureBand ( _sdkVersion ) ;
73
-
74
- _installedFeatureBand = installedFeatureBand == null ? new SdkFeatureBand ( Product . Version ) : new SdkFeatureBand ( installedFeatureBand ) ;
74
+ _installedSdkVersion = new ReleaseVersion ( version ?? Product . Version ) ;
75
+ _installedFeatureBand = new SdkFeatureBand ( installedFeatureBand ?? Product . Version ) ;
75
76
76
77
_fromRollbackDefinition = parseResult . GetValueForOption ( InstallingWorkloadCommandParser . FromRollbackFileOption ) ;
77
78
var configOption = parseResult . GetValueForOption ( InstallingWorkloadCommandParser . ConfigOption ) ;
78
79
var sourceOption = parseResult . GetValueForOption ( InstallingWorkloadCommandParser . SourceOption ) ;
79
80
_packageSourceLocation = string . IsNullOrEmpty ( configOption ) && ( sourceOption == null || ! sourceOption . Any ( ) ) ? null :
80
81
new PackageSourceLocation ( string . IsNullOrEmpty ( configOption ) ? null : new FilePath ( configOption ) , sourceFeedOverrides : sourceOption ) ;
81
82
82
- var sdkWorkloadManifestProvider = new SdkDirectoryWorkloadManifestProvider ( _dotnetPath , _installedFeatureBand . ToString ( ) , userProfileDir ) ;
83
- _workloadResolver = workloadResolver ?? WorkloadResolver . Create ( sdkWorkloadManifestProvider , _dotnetPath , _installedFeatureBand . ToString ( ) , _userProfileDir ) ;
83
+ var sdkWorkloadManifestProvider = new SdkDirectoryWorkloadManifestProvider ( _dotnetPath , _installedSdkVersion . ToString ( ) , userProfileDir ) ;
84
+ _workloadResolver = workloadResolver ?? WorkloadResolver . Create ( sdkWorkloadManifestProvider , _dotnetPath , _installedSdkVersion . ToString ( ) , _userProfileDir ) ;
84
85
85
86
_workloadInstallerFromConstructor = workloadInstaller ;
86
87
_workloadManifestUpdaterFromConstructor = workloadManifestUpdater ;
@@ -109,7 +110,7 @@ protected async Task<List<WorkloadDownload>> GetDownloads(IEnumerable<WorkloadId
109
110
folderForManifestDownloads = tempPath . Value ;
110
111
}
111
112
112
- var manifestDownloads = await _workloadManifestUpdater . GetManifestPackageDownloadsAsync ( includePreview , new SdkFeatureBand ( _sdkVersion ) , _installedFeatureBand ) ;
113
+ var manifestDownloads = await _workloadManifestUpdater . GetManifestPackageDownloadsAsync ( includePreview , _sdkFeatureBand , _installedFeatureBand ) ;
113
114
114
115
if ( ! manifestDownloads . Any ( ) )
115
116
{
0 commit comments