diff --git a/eng/Versions.props b/eng/Versions.props index 96203a6820c..fd70c536c3e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -84,7 +84,7 @@ 1.0.0-prerelease.21511.3 2.0.0-preview.1.21474.2 2.0.0-preview.1.21474.2 - 6.0.100-preview.5.21254.11 + 6.0.100-rtm.21515.10 1.0.0-preview1.1.21116.1 diff --git a/src/Microsoft.DotNet.Build.Tasks.Workloads.Tests/VisualStudioComponentTests.cs b/src/Microsoft.DotNet.Build.Tasks.Workloads.Tests/VisualStudioComponentTests.cs index 2e4c8c1518a..e9b92c0c0ad 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Workloads.Tests/VisualStudioComponentTests.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Workloads.Tests/VisualStudioComponentTests.cs @@ -22,7 +22,7 @@ public class VisualStudioComponentTests public void ItAssignsDefaultValues() { WorkloadManifest manifest = Create("WorkloadManifest.json"); - WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value; + WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value; VisualStudioComponent component = VisualStudioComponent.Create(null, manifest, definition, NoItems, NoItems, NoItems, NoItems); string swixProjDirectory = RandomPath; @@ -40,7 +40,7 @@ public void ItAssignsDefaultValues() public void ItCanOverrideDefaultValues() { WorkloadManifest manifest = Create("WorkloadManifest.json"); - WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value; + WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value; ITaskItem[] resources = new ITaskItem[] { @@ -68,7 +68,7 @@ public void ItCanOverrideDefaultValues() public void ItCreatesSafeComponentIds() { WorkloadManifest manifest = Create("WorkloadManifest.json"); - WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value; + WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value; VisualStudioComponent component = VisualStudioComponent.Create(null, manifest, definition, NoItems, NoItems, NoItems, NoItems); string swixProjDirectory = RandomPath; @@ -84,7 +84,7 @@ public void ItCreatesSafeComponentIds() public void ItCreatesComponentsWhenWorkloadsDoNotIncludePacks() { WorkloadManifest manifest = Create("mauiWorkloadManifest.json"); - WorkloadDefinition definition = manifest.Workloads.FirstOrDefault().Value; + WorkloadDefinition definition = (WorkloadDefinition)manifest.Workloads.FirstOrDefault().Value; VisualStudioComponent component = VisualStudioComponent.Create(null, manifest, definition, NoItems, NoItems, NoItems, NoItems); string swixProjDirectory = RandomPath; diff --git a/src/Microsoft.DotNet.Build.Tasks.Workloads/src/GenerateWorkloadMsis.cs b/src/Microsoft.DotNet.Build.Tasks.Workloads/src/GenerateWorkloadMsis.cs index 8179d2164dc..313305b8eb7 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Workloads/src/GenerateWorkloadMsis.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Workloads/src/GenerateWorkloadMsis.cs @@ -140,9 +140,11 @@ private IEnumerable GetWorkloadPacks() // platform includes Windows var workloads = manifests.SelectMany(m => m.Workloads). Select(w => w.Value). - Where(wd => (wd.Platforms == null) || wd.Platforms.Any(p => p.StartsWith("win"))); + Where(wd => wd is WorkloadDefinition). + Where(wd => (((WorkloadDefinition)wd).Platforms == null) || ((WorkloadDefinition)wd).Platforms.Any(p => p.StartsWith("win"))); - var packIds = workloads.Where(w => w.Packs != null).SelectMany(w => w.Packs).Distinct(); + var packIds = workloads.Where(wd => wd is WorkloadDefinition). + Where(w => (((WorkloadDefinition)w).Packs != null)).SelectMany(w => ((WorkloadDefinition)w).Packs).Distinct(); return manifests.SelectMany(m => m.Packs.Values). Where(p => packIds.Contains(p.Id)). diff --git a/src/Microsoft.DotNet.Build.Tasks.Workloads/src/VisualStudioComponent.cs b/src/Microsoft.DotNet.Build.Tasks.Workloads/src/VisualStudioComponent.cs index 47cb493151c..97f9d1ac855 100644 --- a/src/Microsoft.DotNet.Build.Tasks.Workloads/src/VisualStudioComponent.cs +++ b/src/Microsoft.DotNet.Build.Tasks.Workloads/src/VisualStudioComponent.cs @@ -249,7 +249,7 @@ public static VisualStudioComponent Create(TaskLoggingHelper log, WorkloadManife // processing direct pack dependencies if (workload.Extends?.Count() > 0) { - foreach (WorkloadDefinitionId dependency in workload.Extends) + foreach (WorkloadId dependency in workload.Extends) { // Component dependencies, aka. workload extensions only have minimum version dependencies. component.AddDependency($"{Utils.ToSafeId(dependency.ToString())}", new Version("1.0.0.0"), maxVersion: null);