126 instantiations of SdkFeatureBand
dotnet (60)
Commands\Workload\Clean\WorkloadCleanCommand.cs (2)
48var sdkFeatureBand = new SdkFeatureBand(_sdkVersion); 105VisualStudioWorkloads.GetInstalledWorkloads(bandedResolver, vsWorkloads, _cleanAll ? null : new SdkFeatureBand(sdkVersion));
Commands\Workload\Config\WorkloadConfigCommand.cs (1)
46_sdkFeatureBand = new SdkFeatureBand(_sdkVersion);
Commands\Workload\History\WorkloadHistoryCommand.cs (1)
34_sdkFeatureBand = new SdkFeatureBand(_sdkVersion);
Commands\Workload\Install\FileBasedInstaller.cs (9)
281var newManifestPackageId = GetManifestPackageId(manifestUpdate.ManifestId, new SdkFeatureBand(manifestUpdate.NewFeatureBand)); 288WriteManifestInstallationRecord(manifestUpdate.ManifestId, manifestUpdate.NewVersion, new SdkFeatureBand(manifestUpdate.NewFeatureBand), _sdkFeatureBand); 292RemoveManifestInstallationRecord(manifestUpdate.ManifestId, manifestUpdate.NewVersion, new SdkFeatureBand(manifestUpdate.NewFeatureBand), _sdkFeatureBand); 406var installedSdkFeatureBands = NETCoreSdkResolverNativeWrapper.GetAvailableSdks(_dotnetDir).Select(sdkDir => new SdkFeatureBand(Path.GetFileName(sdkDir))).ToHashSet(); 758var workloadSetFeatureBand = new SdkFeatureBand(Path.GetFileName(workloadSetFeatureBandDir)); 761var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 812var manifestFeatureBand = new SdkFeatureBand(Path.GetFileName(manifestFeatureBandDir)); 815var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 854var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(bandRecord));
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (4)
199if (garbageCollector.ManifestsToKeep.Contains((new ManifestId(manifestRecord.ManifestId), new ManifestVersion(manifestRecord.ManifestVersion), new SdkFeatureBand(manifestRecord.ManifestFeatureBand)))) 403SdkFeatureBand dependentFeatureBand = new(dependentParts[1]); 570string msiPackageId = GetManifestPackageId(manifestUpdate.ManifestId, new SdkFeatureBand(manifestUpdate.NewFeatureBand)).ToString(); 974installedFeatureBands.Add(new SdkFeatureBand(sdkVersion));
Commands\Workload\Install\NetSdkMsiInstallerClient.InstallRecords.cs (2)
36string workloadSetVersion = WorkloadSetVersion.FromWorkloadSetPackageVersion(new SdkFeatureBand(workloadSetFeatureBand), workloadSetPackageVersion); 149var manifestFeatureBand = new SdkFeatureBand(releaseVersion);
Commands\Workload\Install\NetSdkMsiInstallerServer.cs (8)
71RecordRepository.WriteWorkloadInstallationRecord(new WorkloadId(request.WorkloadId), new SdkFeatureBand(request.SdkFeatureBand)); 76RecordRepository.DeleteWorkloadInstallationRecord(new WorkloadId(request.WorkloadId), new SdkFeatureBand(request.SdkFeatureBand)); 99SaveInstallStateManifestVersions(new SdkFeatureBand(request.SdkFeatureBand), request.InstallStateManifestVersions); 104RemoveManifestsFromInstallState(new SdkFeatureBand(request.SdkFeatureBand)); 109UpdateInstallMode(new SdkFeatureBand(request.SdkFeatureBand), request.UseWorkloadSets); 115AdjustWorkloadSetInInstallState(new SdkFeatureBand(request.SdkFeatureBand), request.WorkloadSetVersion); 120RecordWorkloadSetInGlobalJson(new SdkFeatureBand(request.SdkFeatureBand), request.GlobalJsonPath, request.WorkloadSetVersion); 130GlobalJsonWorkloadSetVersions = GetGlobalJsonWorkloadSetVersions(new SdkFeatureBand(request.SdkFeatureBand))
Commands\Workload\Install\WorkloadGarbageCollector.cs (1)
150var manifestKey = (new ManifestId(manifest.Id), new ManifestVersion(manifest.Version), new SdkFeatureBand(manifest.ManifestFeatureBand));
Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (1)
22.Select(path => new SdkFeatureBand(Path.GetFileName(path)));
Commands\Workload\Install\WorkloadInstallRecords\RegistryWorkloadInstallationRecordRepository.cs (1)
78select new SdkFeatureBand(name))];
Commands\Workload\Install\WorkloadManifestUpdater.cs (7)
52_sdkFeatureBand = sdkFeatureBand ?? new SdkFeatureBand(_workloadResolver.GetSdkFeatureBand()); 74var installer = WorkloadInstallerFactory.GetWorkloadInstaller(reporter, new SdkFeatureBand(sdkVersion), 162SdkFeatureBand featureBand = new(Product.Version); 274var fallbackFeatureBand = new SdkFeatureBand(manifest.ManifestFeatureBand); 397var fallbackFeatureBand = new SdkFeatureBand(manifest.ManifestFeatureBand); 428adManifestFeatureBand = new SdkFeatureBand(File.ReadAllText(adManifestFeatureBandPath)); 438return new(new ManifestVersion(_workloadResolver.GetManifestVersion(manifestId.ToString())), new SdkFeatureBand(_workloadResolver.GetManifestFeatureBand(manifestId.ToString())));
Commands\Workload\InstallingWorkloadCommand.cs (2)
128_sdkFeatureBand = new SdkFeatureBand(creationResult.SdkVersion); 384var manifestDownloads = await _workloadManifestUpdater.GetManifestPackageDownloadsAsync(includePreview, new SdkFeatureBand(_targetSdkVersion), _sdkFeatureBand);
Commands\Workload\List\VisualStudioWorkloads.cs (1)
139SdkFeatureBand visualStudioSdkFeatureBand = new(visualStudioSdkVersion);
Commands\Workload\Repair\WorkloadRepairCommand.cs (3)
52var sdkFeatureBand = new SdkFeatureBand(_sdkVersion); 72var workloadIds = _workloadInstaller.GetWorkloadInstallationRecordRepository().GetInstalledWorkloads(new SdkFeatureBand(_sdkVersion)); 82ReinstallWorkloadsBasedOnCurrentManifests(workloadIds, new SdkFeatureBand(_sdkVersion));
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
30var workloadInstaller = WorkloadInstallerFactory.GetWorkloadInstaller(NullReporter.Instance, new SdkFeatureBand(creationResult.SdkVersion),
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (5)
55_installer = installer ?? GenerateInstaller(Reporter, new SdkFeatureBand(_sdkVersion), _resolver, Verbosity, result.HasOption(SharedOptions.InteractiveOption)); 61new SdkFeatureBand(_sdkVersion).IsPrerelease; 93Utils.Reporter.Error.WriteLine(string.Format(CliCommandStrings.NoWorkloadVersionsFound, new SdkFeatureBand(_sdkVersion))); 156return GetVersions(numberOfWorkloadSetsToTake, new SdkFeatureBand(_sdkVersion), _installer, _includePreviews, PackageDownloader, _resolver); 171return FindBestWorkloadSetsFromComponents(new SdkFeatureBand(_sdkVersion), _installer, _includePreviews, PackageDownloader, _workloadVersion, _resolver, _numberOfWorkloadSetsToTake);
Commands\Workload\Uninstall\WorkloadUninstallCommand.cs (2)
48var sdkFeatureBand = new SdkFeatureBand(_sdkVersion); 62var featureBand = new SdkFeatureBand(_sdkVersion);
Commands\Workload\WorkloadCommandParser.cs (1)
128reporter.WriteLine($" {WorkloadInstallType.GetWorkloadInstallType(new SdkFeatureBand(Product.Version), dotnetPath).ToString(),align}"
Commands\Workload\WorkloadHistoryRecorder.cs (1)
62.GetInstalledWorkloads(new SdkFeatureBand(_workloadResolver.GetSdkFeatureBand())).Select(id => id.ToString())],
Commands\Workload\WorkloadInfoHelper.cs (3)
39_currentSdkFeatureBand = new SdkFeatureBand(currentSdkReleaseVersion); 94if (new SdkFeatureBand(_targetSdkVersion).CompareTo(_currentSdkFeatureBand) < 0) 97$"Version band of {_targetSdkVersion} --- {new SdkFeatureBand(_targetSdkVersion)} should not be smaller than current version band {_currentSdkFeatureBand}");
Commands\Workload\WorkloadIntegrityChecker.cs (1)
19var sdkFeatureBand = new SdkFeatureBand(creationResult.SdkVersion);
WorkloadFileBasedInstall.cs (1)
44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
WorkloadSetVersion.cs (2)
40sdkFeatureBand = new SdkFeatureBand(workloadSetVersion); 47sdkFeatureBand = new SdkFeatureBand($"{major}.{minor}.{patch}");
dotnet.Tests (47)
CommandTests\Workload\Install\GivenDotnetWorkloadInstall.cs (4)
214var featureBand = new SdkFeatureBand(sdkVersion); 229installer.InstalledManifests[0].manifestUpdate.NewFeatureBand.Should().Be(new SdkFeatureBand(sdkVersion).ToString()); 240var featureBand = new SdkFeatureBand(sdkVersion); 260installer.InstalledManifests[0].manifestUpdate.NewFeatureBand.Should().Be(new SdkFeatureBand(sdkVersion).ToString());
CommandTests\Workload\Install\GivenFileBasedWorkloadInstall.cs (18)
36var sdkFeatureBand = new SdkFeatureBand(stringFeatureBand); 72new SdkFeatureBand("6.0.100"), 73new SdkFeatureBand("6.0.300"), 74new SdkFeatureBand("7.0.100") 125var installedWorkloads = installer.GetWorkloadInstallationRecordRepository().GetInstalledWorkloads(new SdkFeatureBand(version)); 135installer.GetWorkloadInstallationRecordRepository().WriteWorkloadInstallationRecord(workloadId, new SdkFeatureBand(version)); 150CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context)); 173CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-templates-workload") }, new SdkFeatureBand(version), context)); 198CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-buildtools-workload") }, new SdkFeatureBand(version), context)); 218CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context)); 236CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context)); 251CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context)); 324var featureBand = new SdkFeatureBand("6.0.100"); 363var downloads = installer.GetDownloads(new[] { new WorkloadId("android-sdk-workload"), new WorkloadId("android-buildtools-workload") }, new SdkFeatureBand(version), false).ToList(); 390CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context, new DirectoryPath(cachePath))); 415CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context, new DirectoryPath(cachePath)))); 428var sdkFeatureBand = new SdkFeatureBand("6.0.300"); 432if (workloadSetVersion != null && !sdkFeatureBand.Equals(new SdkFeatureBand(workloadSetVersion)))
CommandTests\Workload\Install\GivenWorkloadManifestUpdater.cs (7)
197SdkFeatureBand = new SdkFeatureBand(currentFeatureBand) 237SdkFeatureBand = new SdkFeatureBand(sdkFeatureBand) 315SdkFeatureBand = new SdkFeatureBand(sdkFeatureBand) 381SdkFeatureBand = new SdkFeatureBand(sdkFeatureBand) 584var sdkFeatureBand = new SdkFeatureBand(TestContext.Current.ToolsetUnderTest.SdkVersion); 622var sdkFeatureBand = new SdkFeatureBand(TestContext.Current.ToolsetUnderTest.SdkVersion); 721SdkFeatureBand = new SdkFeatureBand(featureBand),
CommandTests\Workload\Install\MockManifestProvider.cs (2)
21SdkFeatureBand = new SdkFeatureBand("6.0.100"); 27SdkFeatureBand = new SdkFeatureBand("6.0.100");
CommandTests\Workload\Install\MockPackWorkloadInstaller.cs (2)
122public WorkloadSet GetWorkloadSetContents(string workloadSetVersion) => WorkloadSet.FromJson(workloadSetContents[workloadSetVersion], new SdkFeatureBand("6.0.100")); 127InstalledWorkloadSet = WorkloadSet.FromJson(workloadSetContents[workloadSetVersion], new SdkFeatureBand("6.0.100"));
CommandTests\Workload\Install\WorkloadGarbageCollectionTests.cs (2)
393var sdkFeatureBand = new SdkFeatureBand(sdkVersion); 404if (workloadSetVersion != null && !sdkFeatureBand.Equals(new SdkFeatureBand(workloadSetVersion)))
CommandTests\Workload\Install\WorkloadSetVersionMappingTests.cs (2)
50featureBand.Should().Be(new SdkFeatureBand(expectedFeatureBand)); 57string workloadSetVersion = WorkloadSetVersion.FromWorkloadSetPackageVersion(new SdkFeatureBand(packageFeatureBand), packageVersion);
CommandTests\Workload\List\GivenAnMsiInstallation.cs (6)
32var records = RecordManager.GetInstalledWorkloads(new SdkFeatureBand("6.0.200")); 44var records = RecordManager.GetInstalledWorkloads(new SdkFeatureBand("6.0.100")); 47RecordManager.DeleteWorkloadInstallationRecord(new WorkloadId("workload.B"), new SdkFeatureBand("6.0.100")); 49records = RecordManager.GetInstalledWorkloads(new SdkFeatureBand("6.0.100")); 64Assert.DoesNotContain(new SdkFeatureBand("6.0.300"), records); 74RecordManager.WriteWorkloadInstallationRecord(new WorkloadId(workloadId), new SdkFeatureBand(sdkFeatureBand));
CommandTests\Workload\List\GivenWorkloadInstallerAndWorkloadsInstalled.cs (2)
49var currentSdkFeatureBand = new SdkFeatureBand(CurrentSdkVersion); 197SdkFeatureBand featureBand = new(new ReleaseVersion(6, 0, 100));
CommandTests\Workload\Update\GivenDotnetWorkloadUpdate.cs (2)
247var installStatePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(new SdkFeatureBand(sdkFeatureVersion), installRoot), "default.json"); 635var copiedManifestFolder = Path.Combine(dotnetRoot, "sdk-manifests", new SdkFeatureBand(sdkVersion).ToString(), "SampleManifest");
dotnet-MsiInstallation.Tests (8)
Framework\VMTestBase.cs (1)
235return WorkloadSet.FromJson(filteredOutput, defaultFeatureBand: new SdkFeatureBand(SdkInstallerVersion));
MsiInstallerTests.cs (2)
167foreach (var kvp in originalManifests.ManifestVersions.Concat(WorkloadSet.FromJson(Rollback8_0_101, new SdkFeatureBand(SdkInstallerVersion)).ManifestVersions)) 189var featureBand = new SdkFeatureBand(SdkInstallerVersion);
WorkloadSetTests.cs (2)
340searchVersionResult.StdErr.Should().Contain($"No workload versions found for SDK feature band {new SdkFeatureBand(SdkInstallerVersion)}"); 362var searchResultWorkloadSet = WorkloadSet.FromDictionaryForJson(JsonSerializer.Deserialize<Dictionary<string, string>>(searchResultJson["manifestVersions"]), new SdkFeatureBand(SdkInstallerVersion));
WorkloadSetTestsBase.cs (1)
41var featureBand = new SdkFeatureBand(SdkInstallerVersion).ToStringWithoutPrerelease();
WorkloadSetVersion.cs (2)
40sdkFeatureBand = new SdkFeatureBand(workloadSetVersion); 47sdkFeatureBand = new SdkFeatureBand($"{major}.{minor}.{patch}");
Microsoft.DotNet.TemplateLocator (11)
SdkDirectoryWorkloadManifestProvider.cs (4)
69_sdkVersionBand = new SdkFeatureBand(sdkVersion); 131var workloadSets80100 = GetAvailableWorkloadSets(new SdkFeatureBand("8.0.100")); 473.Select(featureBand => new SdkFeatureBand(featureBand)) 554var featureBand = new SdkFeatureBand(featureBandDirectoryName);
WorkloadFileBasedInstall.cs (1)
44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
WorkloadSet.cs (4)
25ManifestVersions = manifests.ToDictionary(m => new ManifestId(m.Id), m => (new ManifestVersion(m.Version), new SdkFeatureBand(m.ManifestFeatureBand))) 55manifestFeatureBand = new SdkFeatureBand(parts?[1]); 147sdkFeatureBand = new SdkFeatureBand(setVersion); 155sdkFeatureBand = new SdkFeatureBand($"{major}.{minor}.{patch}");
WorkloadSetVersion.cs (2)
40sdkFeatureBand = new SdkFeatureBand(workloadSetVersion); 47sdkFeatureBand = new SdkFeatureBand($"{major}.{minor}.{patch}");
249 references to SdkFeatureBand
dotnet (170)
Commands\Workload\Clean\WorkloadCleanCommand.cs (1)
48var sdkFeatureBand = new SdkFeatureBand(_sdkVersion);
Commands\Workload\Config\WorkloadConfigCommand.cs (1)
24private readonly SdkFeatureBand _sdkFeatureBand;
Commands\Workload\GlobalJsonWorkloadSetFile.cs (1)
11internal class GlobalJsonWorkloadSetsFile(SdkFeatureBand sdkFeatureBand, string dotnetDir)
Commands\Workload\History\WorkloadHistoryCommand.cs (1)
20private readonly SdkFeatureBand _sdkFeatureBand;
Commands\Workload\Install\FileBasedInstaller.cs (63)
38private readonly SdkFeatureBand _sdkFeatureBand; 46SdkFeatureBand sdkFeatureBand, 100string workloadSetPackageVersion = WorkloadSetVersion.ToWorkloadSetPackageVersion(workloadSetVersion, out SdkFeatureBand workloadSetFeatureBand); 130string workloadSetPackageVersion = WorkloadSetVersion.ToWorkloadSetPackageVersion(workloadSetVersion, out var workloadSetFeatureBand); 138public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 143public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, bool overwriteExistingPacks, DirectoryPath? offlineCache = null) 263public void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null) 381public IEnumerable<WorkloadDownload> GetDownloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, bool includeInstalledItems) 415Dictionary<(string workloadSetVersion, SdkFeatureBand workloadSetFeatureBand), List<SdkFeatureBand>> workloadSetInstallRecords = GetAllWorkloadSetInstallRecords(); 419WorkloadSetVersion.ToWorkloadSetPackageVersion(workloadSetVersion, out var workloadSetFeatureBand); 421List<SdkFeatureBand> referencingFeatureBands; 427List<SdkFeatureBand> featureBandsToRemove = []; 428foreach (var referencingFeatureBand in referencingFeatureBands) 443foreach (var featureBandToRemove in featureBandsToRemove) 463Dictionary<(ManifestId manifestId, ManifestVersion manifestVersion, SdkFeatureBand manifestFeatureBand), List<SdkFeatureBand>> manifestInstallRecords = GetAllManifestInstallRecords(); 467List<SdkFeatureBand> featureBandsToRemove = []; 468foreach (var referencingFeatureBand in referencingFeatureBands) 483foreach (var featureBandToRemove in featureBandsToRemove) 500Dictionary<(WorkloadPackId packId, string packVersion), List<SdkFeatureBand>> packInstallRecords = GetAllPackInstallRecords(); 504List<SdkFeatureBand> featureBandsToRemove = []; 505foreach (var referencingFeatureBand in referencingFeatureBands) 533foreach (var featureBand in featureBandsToRemove) 564public void AdjustWorkloadSetInInstallState(SdkFeatureBand sdkFeatureBand, string workloadVersion) 569public void RemoveManifestsFromInstallState(SdkFeatureBand sdkFeatureBand) 574public void SaveInstallStateManifestVersions(SdkFeatureBand sdkFeatureBand, Dictionary<string, string> manifestContents) 579public void UpdateInstallMode(SdkFeatureBand sdkFeatureBand, bool? newMode) 587private void UpdateInstallState(SdkFeatureBand sdkFeatureBand, Action<InstallStateContents> update) 596public void RecordWorkloadSetInGlobalJson(SdkFeatureBand sdkFeatureBand, string globalJsonPath, string workloadSetVersion) 601public Dictionary<string, string> GetGlobalJsonWorkloadSetVersions(SdkFeatureBand sdkFeatureBand) 614foreach (SdkFeatureBand potentialBandToClean in allFeatureBands) 649public PackageId GetManifestPackageId(ManifestId manifestId, SdkFeatureBand featureBand) 725string GetWorkloadSetInstallRecordPath(string workloadSetVersion, SdkFeatureBand workloadSetFeatureBand, SdkFeatureBand referencingFeatureBand) => 728void WriteWorkloadSetInstallationRecord(string workloadSetVersion, SdkFeatureBand workloadSetFeatureBand, SdkFeatureBand referencingFeatureBand) 736void RemoveWorkloadSetInstallationRecord(string workloadSetVersion, SdkFeatureBand workloadSetFeatureBand, SdkFeatureBand referencingFeatureBand) 742private Dictionary<(string workloadSetVersion, SdkFeatureBand workloadSetFeatureBand), List<SdkFeatureBand>> GetAllWorkloadSetInstallRecords() 744Dictionary<(string workloadSetVersion, SdkFeatureBand workloadSetFeatureBand), List<SdkFeatureBand>> records = []; 758var workloadSetFeatureBand = new SdkFeatureBand(Path.GetFileName(workloadSetFeatureBandDir)); 761var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 776private string GetManifestInstallRecordPath(ManifestId manifestId, ManifestVersion manifestVersion, SdkFeatureBand featureBand, SdkFeatureBand referencingFeatureBand) => 779void WriteManifestInstallationRecord(ManifestId manifestId, ManifestVersion manifestVersion, SdkFeatureBand featureBand, SdkFeatureBand referencingFeatureBand) 787void RemoveManifestInstallationRecord(ManifestId manifestId, ManifestVersion manifestVersion, SdkFeatureBand featureBand, SdkFeatureBand referencingFeatureBand) 793private Dictionary<(ManifestId manifestId, ManifestVersion manifestVersion, SdkFeatureBand manifestFeatureBand), List<SdkFeatureBand>> GetAllManifestInstallRecords() 795Dictionary<(ManifestId manifestId, ManifestVersion manifestVersion, SdkFeatureBand manifestFeatureBand), List<SdkFeatureBand>> records = []; 812var manifestFeatureBand = new SdkFeatureBand(Path.GetFileName(manifestFeatureBandDir)); 815var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 832private string GetPackInstallRecordPath(WorkloadPackId packId, string packVersion, SdkFeatureBand featureBand) => 835private Dictionary<(WorkloadPackId packId, string packVersion), List<SdkFeatureBand>> GetAllPackInstallRecords() 837Dictionary<(WorkloadPackId packId, string packVersion), List<SdkFeatureBand>> records = []; 854var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(bandRecord)); 869private void WritePackInstallationRecord(PackInfo packInfo, SdkFeatureBand featureBand) 880private void DeletePackInstallationRecord(PackInfo packInfo, SdkFeatureBand featureBand)
Commands\Workload\Install\IInstaller.cs (9)
19void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null); 21void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null); 31IEnumerable<WorkloadDownload> GetDownloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, bool includeInstalledItems); 33void AdjustWorkloadSetInInstallState(SdkFeatureBand sdkFeatureBand, string workloadVersion); 52void RemoveManifestsFromInstallState(SdkFeatureBand sdkFeatureBand); 59void SaveInstallStateManifestVersions(SdkFeatureBand sdkFeatureBand, Dictionary<string, string> manifestContents); 61void UpdateInstallMode(SdkFeatureBand sdkFeatureBand, bool? newMode); 63void RecordWorkloadSetInGlobalJson(SdkFeatureBand sdkFeatureBand, string globalJsonPath, string workloadSetVersion); 69PackageId GetManifestPackageId(ManifestId manifestId, SdkFeatureBand featureBand);
Commands\Workload\Install\IWorkloadManifestUpdater.cs (2)
24Task<IEnumerable<WorkloadDownload>> GetManifestPackageDownloadsAsync(bool includePreviews, SdkFeatureBand providedSdkFeatureBand, SdkFeatureBand installedSdkFeatureBand);
Commands\Workload\Install\MsiInstallerBase.cs (6)
198protected void UpdateInstallMode(SdkFeatureBand sdkFeatureBand, bool? newMode) 226public void AdjustWorkloadSetInInstallState(SdkFeatureBand sdkFeatureBand, string workloadVersion) 255public void RecordWorkloadSetInGlobalJson(SdkFeatureBand sdkFeatureBand, string globalJsonPath, string workloadSetVersion) 277public Dictionary<string, string> GetGlobalJsonWorkloadSetVersions(SdkFeatureBand sdkFeatureBand) 544public void RemoveManifestsFromInstallState(SdkFeatureBand sdkFeatureBand) 581public void SaveInstallStateManifestVersions(SdkFeatureBand sdkFeatureBand, Dictionary<string, string> manifestContents)
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (19)
29private SdkFeatureBand _sdkFeatureBand; 45SdkFeatureBand sdkFeatureBand, 82private IEnumerable<(WorkloadPackId Id, string Version)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand) 92public IEnumerable<WorkloadDownload> GetDownloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, bool includeInstalledItems) 134IEnumerable<SdkFeatureBand> installedFeatureBands = GetInstalledFeatureBands(Log); 142(bool shouldBeInstalled, string reason) ShouldBeInstalled(SdkFeatureBand dependentFeatureBand) 191(bool shouldBeInstalled, string reason) ShouldBeInstalled(SdkFeatureBand dependentFeatureBand) 247(bool shouldBeInstalled, string reason) ShouldBeInstalled(SdkFeatureBand dependentFeatureBand) 350SdkFeatureBand workloadSetFeatureBand; 383Func<SdkFeatureBand, (bool shouldBeInstalled, string reason)> shouldBeInstalledFunc 403SdkFeatureBand dependentFeatureBand = new(dependentParts[1]); 522foreach (SdkFeatureBand potentialBandToClean in allFeatureBands) 587public void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null) 613public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 733public PackageId GetManifestPackageId(ManifestId manifestId, SdkFeatureBand featureBand) 967private static IEnumerable<SdkFeatureBand> GetInstalledFeatureBands(ISetupLogger log = null) 969HashSet<SdkFeatureBand> installedFeatureBands = []; 1111SdkFeatureBand sdkFeatureBand, 1174void IInstaller.UpdateInstallMode(SdkFeatureBand sdkFeatureBand, bool? newMode)
Commands\Workload\Install\NetSdkMsiInstallerClient.InstallRecords.cs (1)
149var manifestFeatureBand = new SdkFeatureBand(releaseVersion);
Commands\Workload\Install\WorkloadGarbageCollector.cs (4)
27internal class WorkloadGarbageCollector(string dotnetDir, SdkFeatureBand sdkFeatureBand, IEnumerable<WorkloadId> installedWorkloads, Func<string, IWorkloadResolver> getResolverForWorkloadSet, 30private SdkFeatureBand _sdkFeatureBand = sdkFeatureBand; 38public HashSet<(ManifestId id, ManifestVersion version, SdkFeatureBand featureBand)> ManifestsToKeep = []; 49private readonly Dictionary<(ManifestId id, ManifestVersion version, SdkFeatureBand featureBand), GCAction> _manifests = [];
Commands\Workload\Install\WorkloadInstallerFactory.cs (1)
17SdkFeatureBand sdkFeatureBand,
Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (4)
15public IEnumerable<SdkFeatureBand> GetFeatureBandsWithInstallationRecords() 30public IEnumerable<WorkloadId> GetInstalledWorkloads(SdkFeatureBand featureBand) 44public void WriteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand featureBand) 58public void DeleteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand featureBand)
Commands\Workload\Install\WorkloadInstallRecords\IWorkloadInstallationRecordRepository.cs (4)
12IEnumerable<WorkloadId> GetInstalledWorkloads(SdkFeatureBand sdkFeatureBand); 14void WriteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand); 16void DeleteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand); 18IEnumerable<SdkFeatureBand> GetFeatureBandsWithInstallationRecords();
Commands\Workload\Install\WorkloadInstallRecords\RegistryWorkloadInstallationRecordRepository.cs (5)
50public void DeleteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) 68public IEnumerable<SdkFeatureBand> GetFeatureBandsWithInstallationRecords() 74? Enumerable.Empty<SdkFeatureBand>() 81public IEnumerable<WorkloadId> GetInstalledWorkloads(SdkFeatureBand sdkFeatureBand) 94public void WriteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand)
Commands\Workload\Install\WorkloadManifestUpdater.cs (20)
29private readonly SdkFeatureBand _sdkFeatureBand; 46SdkFeatureBand? sdkFeatureBand = null) 128public static bool ShouldUseWorkloadSetMode(SdkFeatureBand sdkFeatureBand, string dotnetDir) 162SdkFeatureBand featureBand = new(Product.Version); 266public async Task<IEnumerable<WorkloadDownload>> GetManifestPackageDownloadsAsync(bool includePreviews, SdkFeatureBand providedSdkFeatureBand, SdkFeatureBand installedSdkFeatureBand) 274var fallbackFeatureBand = new SdkFeatureBand(manifest.ManifestFeatureBand); 276SdkFeatureBand[] bands = [providedSdkFeatureBand, installedSdkFeatureBand, fallbackFeatureBand]; 279foreach (var band in bands.Distinct()) 312private async Task<bool> UpdateManifestWithVersionAsync(string id, bool includePreviews, SdkFeatureBand band, NuGetVersion packageVersion = null, DirectoryPath? offlineCache = null) 397var fallbackFeatureBand = new SdkFeatureBand(manifest.ManifestFeatureBand); 399SdkFeatureBand[] bands = [_sdkFeatureBand, fallbackFeatureBand]; 400foreach (var band in bands.Distinct()) 425SdkFeatureBand adManifestFeatureBand = _sdkFeatureBand; 488private static IEnumerable<(ManifestId Id, ManifestVersionWithBand ManifestWithBand)> ParseRollbackDefinitionFile(string rollbackDefinitionFilePath, SdkFeatureBand featureBand) 521private string GetAdvertisingManifestSentinelPath(SdkFeatureBand featureBand) => Path.Combine(_userProfileDir, $".workloadAdvertisingManifestSentinel{featureBand}"); 523private string GetAdvertisingWorkloadsFilePath(SdkFeatureBand featureBand) => GetAdvertisingWorkloadsFilePath(_userProfileDir, featureBand); 525private static string GetAdvertisingWorkloadsFilePath(string userProfileDir, SdkFeatureBand featureBand) => Path.Combine(userProfileDir, $".workloadAdvertisingUpdates{featureBand}"); 527private string GetAdvertisingManifestPath(SdkFeatureBand featureBand, ManifestId manifestId) => Path.Combine(_userProfileDir, "sdk-advertising", featureBand.ToString(), manifestId.ToString()); 529private record ManifestVersionWithBand(ManifestVersion Version, SdkFeatureBand Band);
Commands\Workload\InstallingWorkloadCommand.cs (5)
35protected readonly SdkFeatureBand _sdkFeatureBand; 180public static bool ShouldUseWorkloadSetMode(SdkFeatureBand sdkFeatureBand, string dotnetDir) 261var currentPackageVersion = WorkloadSetVersion.ToWorkloadSetPackageVersion(currentWorkloadVersionInfo.Version, out var currentWorkloadSetSdkFeatureBand); 262var advertisedPackageVersion = WorkloadSetVersion.ToWorkloadSetPackageVersion(resolvedWorkloadSetVersion, out var advertisedWorkloadSetSdkFeatureBand); 445var maxPriorFeatureBand = priorFeatureBands.Max();
Commands\Workload\List\VisualStudioWorkloads.cs (2)
104InstalledWorkloadsCollection installedWorkloads, SdkFeatureBand? sdkFeatureBand = null) 139SdkFeatureBand visualStudioSdkFeatureBand = new(visualStudioSdkVersion);
Commands\Workload\Repair\WorkloadRepairCommand.cs (2)
52var sdkFeatureBand = new SdkFeatureBand(_sdkVersion); 104private void ReinstallWorkloadsBasedOnCurrentManifests(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand)
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (4)
65private static IInstaller GenerateInstaller(IReporter reporter, SdkFeatureBand sdkFeatureBand, IWorkloadResolver workloadResolver, VerbosityOptions verbosity, bool interactive) 143PrintableTable<KeyValuePair<ManifestId, (ManifestVersion Version, SdkFeatureBand FeatureBand)>> table = new(); 159private static List<string> GetVersions(int numberOfWorkloadSetsToTake, SdkFeatureBand featureBand, IInstaller installer, bool includePreviews, INuGetPackageDownloader packageDownloader, IWorkloadResolver resolver) 174public static IEnumerable<string> FindBestWorkloadSetsFromComponents(SdkFeatureBand featureBand, IInstaller installer, bool includePreviews, INuGetPackageDownloader packageDownloader, IEnumerable<string> workloadVersions, IWorkloadResolver resolver, int numberOfWorkloadSetsToTake)
Commands\Workload\Uninstall\WorkloadUninstallCommand.cs (2)
48var sdkFeatureBand = new SdkFeatureBand(_sdkVersion); 62var featureBand = new SdkFeatureBand(_sdkVersion);
Commands\Workload\WorkloadInfoHelper.cs (1)
20public readonly SdkFeatureBand _currentSdkFeatureBand;
Commands\Workload\WorkloadIntegrityChecker.cs (1)
19var sdkFeatureBand = new SdkFeatureBand(creationResult.SdkVersion);
Installer\Windows\InstallMessageDispatcher.cs (7)
139public InstallResponseMessage SendWorkloadRecordRequest(InstallRequestType requestType, WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) 154public InstallResponseMessage SendRemoveManifestsFromInstallStateFileRequest(SdkFeatureBand sdkFeatureBand) 169public InstallResponseMessage SendSaveInstallStateManifestVersions(SdkFeatureBand sdkFeatureBand, Dictionary<string, string> manifestContents) 185public InstallResponseMessage SendUpdateWorkloadModeRequest(SdkFeatureBand sdkFeatureBand, bool? newMode) 201public InstallResponseMessage SendUpdateWorkloadSetRequest(SdkFeatureBand sdkFeatureBand, string newVersion) 211public InstallResponseMessage SendRecordWorkloadSetInGlobalJsonRequest(SdkFeatureBand sdkFeatureBand, string globalJsonPath, string workloadSetVersion) 222public InstallResponseMessage SendGetGlobalJsonWorkloadSetVersionsRequest(SdkFeatureBand sdkFeatureBand)
WorkloadSetVersion.cs (4)
28public static string ToWorkloadSetPackageVersion(string workloadSetVersion, out SdkFeatureBand sdkFeatureBand) 59public static SdkFeatureBand GetFeatureBand(string workloadSetVersion) 61ToWorkloadSetPackageVersion(workloadSetVersion, out SdkFeatureBand sdkFeatureBand); 65public static string FromWorkloadSetPackageVersion(SdkFeatureBand sdkFeatureBand, string packageVersion)
dotnet.Tests (42)
CommandTests\New\WorkloadsInfoProviderTests.cs (1)
29.Setup(r => r.GetInstalledWorkloads(It.IsAny<SdkFeatureBand>()))
CommandTests\Workload\Install\GivenDotnetWorkloadInstall.cs (2)
214var featureBand = new SdkFeatureBand(sdkVersion); 240var featureBand = new SdkFeatureBand(sdkVersion);
CommandTests\Workload\Install\GivenFileBasedWorkloadInstall.cs (7)
36var sdkFeatureBand = new SdkFeatureBand(stringFeatureBand); 70SdkFeatureBand[] versions = new[] 79foreach (SdkFeatureBand version in versions) 86IEnumerable<SdkFeatureBand> featureBands = installer.GetWorkloadInstallationRecordRepository().GetFeatureBandsWithInstallationRecords(); 103IEnumerable<SdkFeatureBand> featureBands = installer.GetWorkloadInstallationRecordRepository().GetFeatureBandsWithInstallationRecords(); 324var featureBand = new SdkFeatureBand("6.0.100"); 428var sdkFeatureBand = new SdkFeatureBand("6.0.300");
CommandTests\Workload\Install\GivenWorkloadManifestUpdater.cs (2)
584var sdkFeatureBand = new SdkFeatureBand(TestContext.Current.ToolsetUnderTest.SdkVersion); 622var sdkFeatureBand = new SdkFeatureBand(TestContext.Current.ToolsetUnderTest.SdkVersion);
CommandTests\Workload\Install\MockManifestProvider.cs (1)
30public SdkFeatureBand SdkFeatureBand { get; set; }
CommandTests\Workload\Install\MockPackWorkloadInstaller.cs (15)
69public void UpdateInstallMode(SdkFeatureBand sdkFeatureBand, bool? newMode) 72public void AdjustWorkloadSetInInstallState(SdkFeatureBand sdkFeatureBand, string workloadVersion) 83public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 142public void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null) => throw new NotImplementedException(); 165public IEnumerable<WorkloadDownload> GetDownloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, bool includeInstalledItems) 182public PackageId GetManifestPackageId(ManifestId manifestId, SdkFeatureBand featureBand) 218public void RemoveManifestsFromInstallState(SdkFeatureBand sdkFeatureBand) 229public void SaveInstallStateManifestVersions(SdkFeatureBand sdkFeatureBand, Dictionary<string, string> manifestContents) 238public void RecordWorkloadSetInGlobalJson(SdkFeatureBand sdkFeatureBand, string globalJsonPath, string workloadSetVersion) 243public Dictionary<string, string> GetGlobalJsonWorkloadSetVersions(SdkFeatureBand sdkFeatureBand) 263public void WriteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) 272public void DeleteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) 277public IEnumerable<WorkloadId> GetInstalledWorkloads(SdkFeatureBand sdkFeatureBand) 282public IEnumerable<SdkFeatureBand> GetFeatureBandsWithInstallationRecords() 284return Enumerable.Empty<SdkFeatureBand>();
CommandTests\Workload\Install\MockWorkloadManifestUpdater.cs (2)
59public Task<IEnumerable<WorkloadDownload>> GetManifestPackageDownloadsAsync(bool includePreviews, SdkFeatureBand providedSdkFeatureBand, SdkFeatureBand installedSdkFeatureBand)
CommandTests\Workload\Install\WorkloadGarbageCollectionTests.cs (1)
393var sdkFeatureBand = new SdkFeatureBand(sdkVersion);
CommandTests\Workload\Install\WorkloadSetVersionMappingTests.cs (1)
47string packageVersion = WorkloadSetVersion.ToWorkloadSetPackageVersion(workloadSetVersion, out SdkFeatureBand featureBand);
CommandTests\Workload\List\GivenWorkloadInstallerAndWorkloadsInstalled.cs (6)
49var currentSdkFeatureBand = new SdkFeatureBand(CurrentSdkVersion); 189public void WriteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) => 192public void DeleteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) => 195public IEnumerable<WorkloadId> GetInstalledWorkloads(SdkFeatureBand sdkFeatureBand) 197SdkFeatureBand featureBand = new(new ReleaseVersion(6, 0, 100)); 206public IEnumerable<SdkFeatureBand> GetFeatureBandsWithInstallationRecords() =>
CommandTests\Workload\List\MockWorkloadRecordRepo.cs (4)
18public IEnumerable<WorkloadId> GetInstalledWorkloads(SdkFeatureBand sdkFeatureBand) 23public void DeleteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) => throw new System.NotImplementedException(); 24public IEnumerable<SdkFeatureBand> GetFeatureBandsWithInstallationRecords() => throw new System.NotImplementedException(); 25public void WriteWorkloadInstallationRecord(WorkloadId workloadId, SdkFeatureBand sdkFeatureBand) => throw new System.NotImplementedException();
dotnet-MsiInstallation.Tests (8)
MsiInstallerTests.cs (1)
189var featureBand = new SdkFeatureBand(SdkInstallerVersion);
WorkloadSetTests.cs (2)
264var workloadSetFeatureBand = WorkloadSetVersion.GetFeatureBand(WorkloadSetVersion2); 314var workloadSetFeatureBand = WorkloadSetVersion.GetFeatureBand(WorkloadSetVersion2);
WorkloadSetTestsBase.cs (1)
145var packageVersion = WorkloadSetVersion.ToWorkloadSetPackageVersion(workloadSetVersion, out var sdkFeatureBand);
WorkloadSetVersion.cs (4)
28public static string ToWorkloadSetPackageVersion(string workloadSetVersion, out SdkFeatureBand sdkFeatureBand) 59public static SdkFeatureBand GetFeatureBand(string workloadSetVersion) 61ToWorkloadSetPackageVersion(workloadSetVersion, out SdkFeatureBand sdkFeatureBand); 65public static string FromWorkloadSetPackageVersion(SdkFeatureBand sdkFeatureBand, string packageVersion)
Microsoft.DotNet.TemplateLocator (29)
ManifestSpecifier.cs (1)
6public record class ManifestSpecifier(ManifestId Id, ManifestVersion Version, SdkFeatureBand FeatureBand)
SdkDirectoryWorkloadManifestProvider.cs (5)
19private readonly SdkFeatureBand _sdkVersionBand; 142var workloadSetFeatureBand = WorkloadSetVersion.GetFeatureBand(workloadSetVersion); 521public Dictionary<string, WorkloadSet> GetAvailableWorkloadSets(SdkFeatureBand workloadSetFeatureBand) 526Dictionary<string, WorkloadSet> GetAvailableWorkloadSetsInternal(SdkFeatureBand? workloadSetFeatureBand) 554var featureBand = new SdkFeatureBand(featureBandDirectoryName);
SdkFeatureBand.cs (9)
8public struct SdkFeatureBand : IEquatable<SdkFeatureBand>, IComparable<SdkFeatureBand> 36public bool Equals(SdkFeatureBand other) 41public int CompareTo(SdkFeatureBand other) 48return obj is SdkFeatureBand featureBand && Equals(featureBand); 66public static bool operator >(SdkFeatureBand a, SdkFeatureBand b) => a.CompareTo(b) > 0; 68public static bool operator <(SdkFeatureBand a, SdkFeatureBand b) => a.CompareTo(b) < 0;
WorkloadInstallType.cs (2)
28public static InstallType GetWorkloadInstallType(SdkFeatureBand sdkFeatureBand, string? dotnetDir) => 33public static string GetInstallStateFolder(SdkFeatureBand sdkFeatureBand, string? dotnetDir)
WorkloadSet.cs (8)
12public Dictionary<ManifestId, (ManifestVersion Version, SdkFeatureBand FeatureBand)> ManifestVersions = new(); 29public static WorkloadSet FromDictionaryForJson(IDictionary<string, string?> dictionary, SdkFeatureBand defaultFeatureBand) 35SdkFeatureBand manifestFeatureBand; 66public static WorkloadSet FromJson(string json, SdkFeatureBand defaultFeatureBand) 76public static WorkloadSet? FromWorkloadSetFolder(string path, string workloadSetVersion, SdkFeatureBand defaultFeatureBand) 129public static string WorkloadSetVersionToWorkloadSetPackageVersion(string setVersion, out SdkFeatureBand sdkFeatureBand) 168public static SdkFeatureBand GetWorkloadSetFeatureBand(string setVersion) 170WorkloadSetVersionToWorkloadSetPackageVersion(setVersion, out SdkFeatureBand sdkFeatureBand);
WorkloadSetVersion.cs (4)
28public static string ToWorkloadSetPackageVersion(string workloadSetVersion, out SdkFeatureBand sdkFeatureBand) 59public static SdkFeatureBand GetFeatureBand(string workloadSetVersion) 61ToWorkloadSetPackageVersion(workloadSetVersion, out SdkFeatureBand sdkFeatureBand); 65public static string FromWorkloadSetPackageVersion(SdkFeatureBand sdkFeatureBand, string packageVersion)