Skip to content

Commit a15fd60

Browse files
authored
Merge pull request #18166 from mhutch/workload-redirects
Implement workload redirects
2 parents 239cfd8 + 88fc6b4 commit a15fd60

File tree

102 files changed

+1505
-451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1505
-451
lines changed

src/Cli/dotnet/Installer/Windows/WorkloadPackRecord.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#nullable disable
44

55
using System;
6+
7+
using Microsoft.NET.Sdk.WorkloadManifestReader;
8+
69
using NuGet.Versioning;
710

811
namespace Microsoft.DotNet.Installer.Windows
@@ -25,7 +28,7 @@ public string ProviderKeyName
2528
/// <summary>
2629
/// The ID of the workload pack.
2730
/// </summary>
28-
public string PackId
31+
public WorkloadPackId PackId
2932
{
3033
get;
3134
set;

src/Cli/dotnet/commands/dotnet-sdk/check/LocalizableStrings.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<data name="BundleUpToDateMessage" xml:space="preserve">
133133
<value>Up to date.</value>
134134
</data>
135-
<data name="NewPatchAvaliableMessage" xml:space="preserve">
135+
<data name="NewPatchAvailableMessage" xml:space="preserve">
136136
<value>Patch {0} is available.</value>
137137
</data>
138138
<data name="OutOfSupportMessage" xml:space="preserve">

src/Cli/dotnet/commands/dotnet-sdk/check/RuntimeOutputWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private string GetRuntimeStatusMessage(NetRuntimeInfo runtime)
4949
}
5050
else if (NewerRuntimePatchExists(runtime))
5151
{
52-
return string.Format(LocalizableStrings.NewPatchAvaliableMessage, NewestRuntimePatchVersion(runtime));
52+
return string.Format(LocalizableStrings.NewPatchAvailableMessage, NewestRuntimePatchVersion(runtime));
5353
}
5454
else
5555
{

src/Cli/dotnet/commands/dotnet-sdk/check/SdkOutputWriter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public void PrintSdkInfo()
3333

3434
table.PrintRows(_sdkInfo.OrderBy(sdk => sdk.Version), l => _reporter.WriteLine(l));
3535

36-
if (NewFeatureBandAvaliable())
36+
if (NewFeatureBandAvailable())
3737
{
3838
_reporter.WriteLine();
39-
_reporter.WriteLine(string.Format(LocalizableStrings.NewFeatureBandMessage, NewestFeatureBandAvaliable()));
39+
_reporter.WriteLine(string.Format(LocalizableStrings.NewFeatureBandMessage, NewestFeatureBandAvailable()));
4040
}
4141
}
4242

@@ -52,7 +52,7 @@ private string GetSdkStatusMessage(NetSdkInfo sdk)
5252
}
5353
else if (NewerSdkPatchExists(sdk))
5454
{
55-
return string.Format(LocalizableStrings.NewPatchAvaliableMessage, NewestSdkPatchVersion(sdk));
55+
return string.Format(LocalizableStrings.NewPatchAvailableMessage, NewestSdkPatchVersion(sdk));
5656
}
5757
else
5858
{
@@ -86,12 +86,12 @@ private ReleaseVersion NewestSdkPatchVersion(NetSdkInfo bundle)
8686
}
8787
}
8888

89-
private bool NewFeatureBandAvaliable()
89+
private bool NewFeatureBandAvailable()
9090
{
91-
return NewestFeatureBandAvaliable() > _sdkInfo.Select(sdk => sdk.Version).Max();
91+
return NewestFeatureBandAvailable() > _sdkInfo.Select(sdk => sdk.Version).Max();
9292
}
9393

94-
private ReleaseVersion NewestFeatureBandAvaliable()
94+
private ReleaseVersion NewestFeatureBandAvailable()
9595
{
9696
return _productCollection.OrderByDescending(product => product.ProductVersion).First().LatestSdkVersion;
9797
}

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.cs.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.de.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.es.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.fr.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.it.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.ja.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.ko.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.pl.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.pt-BR.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.ru.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.tr.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.zh-Hans.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-sdk/check/xlf/LocalizableStrings.zh-Hant.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target state="new">Try out the newest .NET SDK features with .NET {0}.</target>
3838
<note />
3939
</trans-unit>
40-
<trans-unit id="NewPatchAvaliableMessage">
40+
<trans-unit id="NewPatchAvailableMessage">
4141
<source>Patch {0} is available.</source>
4242
<target state="new">Patch {0} is available.</target>
4343
<note />

src/Cli/dotnet/commands/dotnet-workload/install/IWorkloadPackInstaller.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.DotNet.Workloads.Workload.Install.InstallRecord;
66
using Microsoft.Extensions.EnvironmentAbstractions;
77
using System.Collections.Generic;
8+
using Microsoft.NET.Sdk.WorkloadManifestReader;
89

910
namespace Microsoft.DotNet.Workloads.Workload.Install
1011
{
@@ -20,6 +21,6 @@ internal interface IWorkloadPackInstaller : IInstaller
2021

2122
void GarbageCollectInstalledWorkloadPacks();
2223

23-
IEnumerable<(string Id, string Version)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand);
24+
IEnumerable<(WorkloadPackId Id, string Version)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand);
2425
}
2526
}

src/Cli/dotnet/commands/dotnet-workload/install/MsiInstallerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private IReadOnlyDictionary<string, List<WorkloadPackRecord>> GetWorkloadPackRec
127127
WorkloadPackRecord record = new WorkloadPackRecord
128128
{
129129
ProviderKeyName = (string)packVersionKey.GetValue("DependencyProviderKey"),
130-
PackId = packId,
130+
PackId = new NET.Sdk.WorkloadManifestReader.WorkloadPackId(packId),
131131
PackVersion = new NuGetVersion(packVersion),
132132
ProductCode = (string)packVersionKey.GetValue("ProductCode"),
133133
ProductVersion = new Version((string)packVersionKey.GetValue("ProductVersion"))

src/Cli/dotnet/commands/dotnet-workload/install/NetSdkManagedInstaller.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,17 @@ public void GarbageCollectInstalledWorkloadPacks()
344344
}
345345
}
346346

347-
public IEnumerable<(string, string)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand)
347+
public IEnumerable<(WorkloadPackId, string)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand)
348348
{
349349
var installedPacksDir = Path.Combine(_workloadMetadataDir, _installedPacksDir, "v1");
350350
if (!Directory.Exists(installedPacksDir))
351351
{
352-
return Enumerable.Empty<(string, string)>();
352+
return Enumerable.Empty<(WorkloadPackId, string)>();
353353
}
354354
return Directory.GetDirectories(installedPacksDir)
355355
.Where(packIdDir => HasFeatureBandMarkerFile(packIdDir, sdkFeatureBand))
356356
.SelectMany(packIdPath => Directory.GetDirectories(packIdPath))
357-
.Select(packVersionPath => (Path.GetFileName(Path.GetDirectoryName(packVersionPath)), Path.GetFileName(packVersionPath)));
357+
.Select(packVersionPath => (new WorkloadPackId(Path.GetFileName(Path.GetDirectoryName(packVersionPath))), Path.GetFileName(packVersionPath)));
358358
}
359359

360360
public void Shutdown()
@@ -376,7 +376,7 @@ private IEnumerable<string> GetExpectedPackInstallRecords(SdkFeatureBand sdkFeat
376376
{
377377
var installedWorkloads = _installationRecordRepository.GetInstalledWorkloads(sdkFeatureBand);
378378
return installedWorkloads
379-
.SelectMany(workload => _workloadResolver.GetPacksInWorkload(workload.ToString()))
379+
.SelectMany(workload => _workloadResolver.GetPacksInWorkload(workload))
380380
.Select(pack => _workloadResolver.TryGetPackInfo(pack))
381381
.Where(pack => pack != null)
382382
.Select(packInfo => GetPackInstallRecordPath(packInfo, sdkFeatureBand));
@@ -387,7 +387,7 @@ private PackInfo GetPackInfo(string packRecordDir)
387387
// Expected path: <DOTNET ROOT>/metadata/workloads/installedpacks/v1/<Pack ID>/<Pack Version>/
388388
var idRecordPath = Path.GetDirectoryName(packRecordDir);
389389
var packId = Path.GetFileName(idRecordPath);
390-
var packInfo = _workloadResolver.TryGetPackInfo(packId);
390+
var packInfo = _workloadResolver.TryGetPackInfo(new WorkloadPackId(packId));
391391
if (packInfo != null && packInfo.Version.Equals(Path.GetFileName(packRecordDir)))
392392
{
393393
return packInfo;

src/Cli/dotnet/commands/dotnet-workload/install/NetSdkMsiInstallerClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ public void GarbageCollectInstalledWorkloadPacks()
9696
IEnumerable<SdkFeatureBand> installedFeatureBands = GetInstalledFeatureBands();
9797
IEnumerable<WorkloadId> installedWorkloads = RecordRepository.GetInstalledWorkloads(_sdkFeatureBand);
9898
IEnumerable<PackInfo> expectedWorkloadPacks = installedWorkloads
99-
.SelectMany(workload => _workloadResolver.GetPacksInWorkload(workload.ToString()))
99+
.SelectMany(workload => _workloadResolver.GetPacksInWorkload(workload))
100100
.Select(pack => _workloadResolver.TryGetPackInfo(pack))
101101
.Where(pack => pack != null);
102-
IEnumerable<string> expectedPackIds = expectedWorkloadPacks.Select(p => p.Id);
102+
IEnumerable<WorkloadPackId> expectedPackIds = expectedWorkloadPacks.Select(p => p.Id);
103103

104104
foreach (PackInfo expectedPack in expectedWorkloadPacks)
105105
{
@@ -219,7 +219,7 @@ public void GarbageCollectInstalledWorkloadPacks()
219219

220220
public InstallationUnit GetInstallationUnit() => InstallationUnit.Packs;
221221

222-
public IEnumerable<(string, string)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand)
222+
public IEnumerable<(WorkloadPackId, string)> GetInstalledPacks(SdkFeatureBand sdkFeatureBand)
223223
{
224224
string dependent = $"{DependentPrefix},{sdkFeatureBand},{HostArchitecture}";
225225

src/Cli/dotnet/commands/dotnet-workload/install/WorkloadInstallCommand.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ internal class WorkloadInstallCommand : CommandBase
3838
private readonly IReadOnlyCollection<string> _workloadIds;
3939
private readonly IInstaller _workloadInstaller;
4040
private IWorkloadResolver _workloadResolver;
41-
private IWorkloadManifestProvider _workloadManifestProvider;
4241
private readonly INuGetPackageDownloader _nugetPackageDownloader;
4342
private readonly IWorkloadManifestUpdater _workloadManifestUpdater;
4443
private readonly ReleaseVersion _sdkVersion;
@@ -80,8 +79,8 @@ public WorkloadInstallCommand(
8079
_packageSourceLocation = string.IsNullOrEmpty(configOption) && (sourceOption == null || !sourceOption.Any()) ? null :
8180
new PackageSourceLocation(string.IsNullOrEmpty(configOption) ? null : new FilePath(configOption), sourceFeedOverrides: sourceOption);
8281

83-
_workloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(_dotnetPath, _sdkVersion.ToString());
84-
_workloadResolver = workloadResolver ?? WorkloadResolver.Create(_workloadManifestProvider, _dotnetPath, _sdkVersion.ToString());
82+
var _sdkWorkloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(_dotnetPath, _sdkVersion.ToString());
83+
_workloadResolver = workloadResolver ?? WorkloadResolver.Create(_sdkWorkloadManifestProvider, _dotnetPath, _sdkVersion.ToString());
8584
var sdkFeatureBand = new SdkFeatureBand(_sdkVersion);
8685
var tempPackagesDir = new DirectoryPath(Path.Combine(_tempDirPath, "dotnet-sdk-advertising-temp"));
8786
var restoreActionConfig = _parseResult.ToRestoreActionConfig();
@@ -95,26 +94,26 @@ public WorkloadInstallCommand(
9594
_workloadResolver, _verbosity, _nugetPackageDownloader, _dotnetPath, _tempDirPath,
9695
_packageSourceLocation, restoreActionConfig, elevationRequired: !_printDownloadLinkOnly && string.IsNullOrWhiteSpace(_downloadToCacheOption));
9796
_userHome = userHome ?? CliFolderPathCalculator.DotnetHomePath;
98-
_workloadManifestUpdater = workloadManifestUpdater ?? new WorkloadManifestUpdater(_reporter, _workloadManifestProvider, _workloadResolver, _nugetPackageDownloader, _userHome, _tempDirPath, _packageSourceLocation);
97+
_workloadManifestUpdater = workloadManifestUpdater ?? new WorkloadManifestUpdater(_reporter, _sdkWorkloadManifestProvider, _workloadResolver, _nugetPackageDownloader, _userHome, _tempDirPath, _packageSourceLocation);
9998

10099
ValidateWorkloadIdsInput();
101100
}
102101

103102
private void ValidateWorkloadIdsInput()
104103
{
105-
var avaliableWorkloads = _workloadResolver.GetAvaliableWorkloads();
104+
var availableWorkloads = _workloadResolver.GetAvailableWorkloads();
106105
foreach (var workloadId in _workloadIds)
107106
{
108-
if (avaliableWorkloads.Select(workload => workload.Id.ToString()).Contains(workloadId))
107+
if (!availableWorkloads.Select(workload => workload.Id.ToString()).Contains(workloadId))
109108
{
110-
if (!_workloadResolver.IsWorkloadPlatformCompatible(new WorkloadId(workloadId)))
109+
if (_workloadResolver.IsPlatformIncompatibleWorkload(new WorkloadId(workloadId)))
111110
{
112111
throw new GracefulException(string.Format(LocalizableStrings.WorkloadNotSupportedOnPlatform, workloadId));
113112
}
114-
}
115-
else
116-
{
117-
throw new GracefulException(string.Format(LocalizableStrings.WorkloadNotRecognized, workloadId));
113+
else
114+
{
115+
throw new GracefulException(string.Format(LocalizableStrings.WorkloadNotRecognized, workloadId));
116+
}
118117
}
119118
}
120119
}
@@ -318,8 +317,8 @@ private async Task UseTempManifestsToResolvePacksAsync(DirectoryPath tempPath, b
318317
return;
319318
}
320319
await _workloadManifestUpdater.ExtractManifestPackagesToTempDirAsync(manifestPackagePaths, tempPath);
321-
_workloadManifestProvider = new TempDirectoryWorkloadManifestProvider(tempPath.Value, _sdkVersion.ToString());
322-
_workloadResolver = _workloadResolver.CreateTempDirResolver(_workloadManifestProvider, _dotnetPath, _sdkVersion.ToString());
320+
var overlayProvider = new TempDirectoryWorkloadManifestProvider(tempPath.Value, _sdkVersion.ToString());
321+
_workloadResolver = _workloadResolver.CreateOverlayResolver(overlayProvider);
323322
}
324323

325324
private async Task DownloadToOfflineCacheAsync(IEnumerable<WorkloadId> workloadIds, DirectoryPath offlineCache, bool skipManifestUpdate, bool includePreviews)
@@ -332,8 +331,8 @@ private async Task DownloadToOfflineCacheAsync(IEnumerable<WorkloadId> workloadI
332331
{
333332
tempManifestDir = Path.Combine(offlineCache.Value, "temp-manifests");
334333
await _workloadManifestUpdater.ExtractManifestPackagesToTempDirAsync(manifestPackagePaths, new DirectoryPath(tempManifestDir));
335-
_workloadManifestProvider = new TempDirectoryWorkloadManifestProvider(tempManifestDir, _sdkVersion.ToString());
336-
_workloadResolver = _workloadResolver.CreateTempDirResolver(_workloadManifestProvider, _dotnetPath, _sdkVersion.ToString());
334+
var overlayProvider = new TempDirectoryWorkloadManifestProvider(tempManifestDir, _sdkVersion.ToString());
335+
_workloadResolver = _workloadResolver.CreateOverlayResolver(overlayProvider);
337336
}
338337
else
339338
{
@@ -374,7 +373,7 @@ private IEnumerable<PackInfo> GetPacksToInstall(IEnumerable<WorkloadId> workload
374373
{
375374
var installedPacks = _workloadInstaller.GetPackInstaller().GetInstalledPacks(_sdkFeatureBand);
376375
return workloadIds
377-
.SelectMany(workloadId => _workloadResolver.GetPacksInWorkload(workloadId.ToString()))
376+
.SelectMany(workloadId => _workloadResolver.GetPacksInWorkload(workloadId))
378377
.Distinct()
379378
.Select(packId => _workloadResolver.TryGetPackInfo(packId))
380379
.Where(pack => pack != null)

src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ private async Task UpdateAdvertisingManifestAsync(ManifestId manifestId, bool in
309309
using (FileStream fsSource = new FileStream(manifestPath, FileMode.Open, FileAccess.Read))
310310
{
311311
var manifest = WorkloadManifestReader.ReadWorkloadManifest(manifestId.ToString(), fsSource);
312-
return (new ManifestVersion(manifest.Version), manifest.Workloads);
312+
return (new ManifestVersion(manifest.Version), manifest.Workloads.Values.OfType<WorkloadDefinition>().ToDictionary(w => w.Id));
313313
}
314314
}
315315

0 commit comments

Comments
 (0)