From 0b24e098a67eccf56a0e521851ebaa5494cd1d6d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 25 Sep 2025 02:19:43 +0000 Subject: [PATCH 1/3] Backflow from https://github.com/dotnet/dotnet / a0ca1b9 build 284548 [[ commit created by automation ]] --- eng/Versions.props | 4 - es-metadata.yml | 8 + ...oft.AspNetCore.Watch.BrowserRefresh.csproj | 4 +- .../Workload/WorkloadCommandParser.cs | 10 +- src/Cli/dotnet/Parser.cs | 6 +- src/Layout/pkg/dotnet-sdk.proj | 3 +- src/Layout/redist/redist.csproj | 2 +- src/Layout/redist/targets/BundledSdks.targets | 2 +- .../redist/targets/BundledTemplates.targets | 9 +- .../targets/GenerateBundledVersions.targets | 22 +- src/RazorSdk/Tool/Json/JsonDataReader.cs | 3 + .../Tool/Json/ObjectReaders_TagHelpers.cs | 119 +++++-- .../Tool/Json/ObjectWriters_TagHelpers.cs | 102 ++++-- .../Tool/Json/WellKnownPropertyNames.cs | 1 + .../ProcessFrameworkReferences.cs | 321 ++++++++---------- 15 files changed, 336 insertions(+), 280 deletions(-) create mode 100644 es-metadata.yml diff --git a/eng/Versions.props b/eng/Versions.props index 4af4f65de40e..45b0d2df37fb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,7 +53,6 @@ https://dotnetclimsrc.blob.core.windows.net/dotnet/ - 3.2.0-preview.25377.103 1.0.0-20230414.1 2.23.0 2.0.1-servicing-26011-01 @@ -62,7 +61,6 @@ 4.8.6 1.2.0-beta.435 4.0.5 - 2.0.0-rc.1.25377.103 2.0.0-beta5.25279.2 1.1.2 10.3.0 @@ -79,7 +77,6 @@ 9.4.0 - 2.1.0 9.0.0 @@ -140,7 +137,6 @@ 8.0.2 8.0.0 4.18.4 - 3.11.0-preview.25381.6 1.3.2 8.0.0-beta.23607.1 0.14.0 diff --git a/es-metadata.yml b/es-metadata.yml new file mode 100644 index 000000000000..af486ad81d2f --- /dev/null +++ b/es-metadata.yml @@ -0,0 +1,8 @@ +schemaVersion: 0.0.1 +isProduction: true +accountableOwners: + service: 30f635d8-2918-48af-8ddf-d9bc854b7584 +routing: + defaultAreaPath: + org: devdiv + path: DevDiv\NET Tools\SDK diff --git a/src/BuiltInTools/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj b/src/BuiltInTools/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj index efa0b352ef7d..b56559840a89 100644 --- a/src/BuiltInTools/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj +++ b/src/BuiltInTools/BrowserRefresh/Microsoft.AspNetCore.Watch.BrowserRefresh.csproj @@ -22,8 +22,8 @@ - - + + diff --git a/src/Cli/dotnet/Commands/Workload/WorkloadCommandParser.cs b/src/Cli/dotnet/Commands/Workload/WorkloadCommandParser.cs index 3c6e0bb43c6d..32a38bdd9af9 100644 --- a/src/Cli/dotnet/Commands/Workload/WorkloadCommandParser.cs +++ b/src/Cli/dotnet/Commands/Workload/WorkloadCommandParser.cs @@ -174,10 +174,7 @@ private static Command ConstructCommand() private class ShowWorkloadsInfoAction : SynchronousCommandLineAction { - public ShowWorkloadsInfoAction() - { - Terminating = true; - } + public override bool Terminating => true; public override int Invoke(ParseResult parseResult) { @@ -189,10 +186,7 @@ public override int Invoke(ParseResult parseResult) private class ShowWorkloadsVersionOption : SynchronousCommandLineAction { - public ShowWorkloadsVersionOption() - { - Terminating = true; - } + public override bool Terminating => true; public override int Invoke(ParseResult parseResult) { diff --git a/src/Cli/dotnet/Parser.cs b/src/Cli/dotnet/Parser.cs index 4bddb07f976e..23dd3d6ebef3 100644 --- a/src/Cli/dotnet/Parser.cs +++ b/src/Cli/dotnet/Parser.cs @@ -427,10 +427,8 @@ public override void Write(HelpContext context) private class PrintCliSchemaAction : SynchronousCommandLineAction { - internal PrintCliSchemaAction() - { - Terminating = true; - } + public override bool Terminating => true; + public override int Invoke(ParseResult parseResult) { CliSchema.PrintCliSchema(parseResult.CommandResult, parseResult.InvocationConfiguration.Output, Program.TelemetryClient); diff --git a/src/Layout/pkg/dotnet-sdk.proj b/src/Layout/pkg/dotnet-sdk.proj index 5d46c9e12b74..85a0964af02c 100644 --- a/src/Layout/pkg/dotnet-sdk.proj +++ b/src/Layout/pkg/dotnet-sdk.proj @@ -8,7 +8,6 @@ true true true - true Microsoft .NET $(RepoRoot)LICENSE.TXT dotnet-sdk @@ -119,7 +118,7 @@ diff --git a/src/Layout/redist/redist.csproj b/src/Layout/redist/redist.csproj index 803a0334f542..22d3827eab44 100644 --- a/src/Layout/redist/redist.csproj +++ b/src/Layout/redist/redist.csproj @@ -29,7 +29,7 @@ - + diff --git a/src/Layout/redist/targets/BundledSdks.targets b/src/Layout/redist/targets/BundledSdks.targets index 242c1c0242d6..77fae4e802bd 100644 --- a/src/Layout/redist/targets/BundledSdks.targets +++ b/src/Layout/redist/targets/BundledSdks.targets @@ -2,7 +2,7 @@ - + diff --git a/src/Layout/redist/targets/BundledTemplates.targets b/src/Layout/redist/targets/BundledTemplates.targets index d0681a419c10..d57efe98784d 100644 --- a/src/Layout/redist/targets/BundledTemplates.targets +++ b/src/Layout/redist/targets/BundledTemplates.targets @@ -3,8 +3,8 @@ - - + + @@ -56,11 +56,6 @@ - - - - - diff --git a/src/Layout/redist/targets/GenerateBundledVersions.targets b/src/Layout/redist/targets/GenerateBundledVersions.targets index 42a5791e65b6..e130c7f81d26 100644 --- a/src/Layout/redist/targets/GenerateBundledVersions.targets +++ b/src/Layout/redist/targets/GenerateBundledVersions.targets @@ -276,14 +276,6 @@ Condition="'$(BundleRuntimePacks)' == 'true'" Include="$(ProductMonikerRid)" /> - - - - + + + + + + + + @@ -711,6 +716,7 @@ Copyright (c) .NET Foundation. All rights reserved. ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler" ILCompilerRuntimePackNamePattern="Microsoft.NETCore.App.Runtime.NativeAOT.**RID**" ILCompilerPackVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)" + ILCompilerPortableRuntimeIdentifiers="@(ILCompilerSupportedPortableRids, '%3B')" ILCompilerRuntimeIdentifiers="@(ILCompilerSupportedRids, '%3B')" /> diff --git a/src/RazorSdk/Tool/Json/JsonDataReader.cs b/src/RazorSdk/Tool/Json/JsonDataReader.cs index 39f7a75f11b2..5528b848ae85 100644 --- a/src/RazorSdk/Tool/Json/JsonDataReader.cs +++ b/src/RazorSdk/Tool/Json/JsonDataReader.cs @@ -368,6 +368,9 @@ public T ReadNonNullObject(string propertyName, ReadProperties readPropert return ReadNonNullObject(readProperties); } + public T ReadNonNullObjectOrDefault(string propertyName, ReadProperties readProperties, T defaultValue) + => TryReadPropertyName(propertyName) ? ReadNonNullObject(readProperties) : defaultValue; + public T[]? ReadArray(ReadValue readElement) { if (TryReadNull()) diff --git a/src/RazorSdk/Tool/Json/ObjectReaders_TagHelpers.cs b/src/RazorSdk/Tool/Json/ObjectReaders_TagHelpers.cs index 62ada0663a93..5fcfe1f919a6 100644 --- a/src/RazorSdk/Tool/Json/ObjectReaders_TagHelpers.cs +++ b/src/RazorSdk/Tool/Json/ObjectReaders_TagHelpers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Components; @@ -14,14 +15,16 @@ public static TagHelperDescriptor ReadTagHelper(JsonDataReader reader) public static TagHelperDescriptor ReadTagHelperFromProperties(JsonDataReader reader) { - var kind = reader.ReadNonNullString(nameof(TagHelperDescriptor.Kind)); + var flags = (TagHelperFlags)reader.ReadByte(nameof(TagHelperDescriptor.Flags)); + var kind = (TagHelperKind)reader.ReadByteOrDefault(nameof(TagHelperDescriptor.Kind), defaultValue: (byte)TagHelperKind.Component); + var runtimeKind = (RuntimeKind)reader.ReadByteOrDefault(nameof(TagHelperDescriptor.RuntimeKind), defaultValue: (byte)RuntimeKind.IComponent); var name = reader.ReadNonNullString(nameof(TagHelperDescriptor.Name)); var assemblyName = reader.ReadNonNullString(nameof(TagHelperDescriptor.AssemblyName)); var displayName = reader.ReadStringOrNull(nameof(TagHelperDescriptor.DisplayName)); + var typeNameObject = ReadTypeNameObject(reader, nameof(TagHelperDescriptor.TypeName)); var documentationObject = ReadDocumentationObject(reader, nameof(TagHelperDescriptor.Documentation)); var tagOutputHint = reader.ReadStringOrNull(nameof(TagHelperDescriptor.TagOutputHint)); - var caseSensitive = reader.ReadBooleanOrTrue(nameof(TagHelperDescriptor.CaseSensitive)); var tagMatchingRules = reader.ReadImmutableArrayOrEmpty(nameof(TagHelperDescriptor.TagMatchingRules), ReadTagMatchingRule); var boundAttributes = reader.ReadImmutableArrayOrEmpty(nameof(TagHelperDescriptor.BoundAttributes), ReadBoundAttribute); @@ -31,9 +34,8 @@ public static TagHelperDescriptor ReadTagHelperFromProperties(JsonDataReader rea var diagnostics = reader.ReadImmutableArrayOrEmpty(nameof(TagHelperDescriptor.Diagnostics), ReadDiagnostic); return new TagHelperDescriptor( - kind, name, assemblyName, - displayName!, documentationObject, - tagOutputHint, caseSensitive, + flags, kind, runtimeKind, name, assemblyName, + displayName!, typeNameObject, documentationObject, tagOutputHint, tagMatchingRules, boundAttributes, allowedChildTags, metadata, diagnostics); @@ -93,25 +95,14 @@ static BoundAttributeDescriptor ReadFromProperties(JsonDataReader reader) var containingType = reader.ReadStringOrNull(nameof(BoundAttributeDescriptor.ContainingType)); var documentationObject = ReadDocumentationObject(reader, nameof(BoundAttributeDescriptor.Documentation)); var parameters = reader.ReadImmutableArrayOrEmpty(nameof(BoundAttributeDescriptor.Parameters), ReadBoundAttributeParameter); - - var metadataKind = (MetadataKind)reader.ReadByteOrDefault("MetadataKind", defaultValue: (byte)MetadataKind.None); - - var metadataObject = metadataKind switch - { - MetadataKind.None => MetadataObject.None, - MetadataKind.TypeParameter => reader.ReadNonNullObject(nameof(BoundAttributeDescriptor.Metadata), ReadTypeParameterMetadata), - MetadataKind.Property => reader.ReadNonNullObject(nameof(BoundAttributeDescriptor.Metadata), ReadPropertyMetadata), - MetadataKind.ChildContentParameter => ChildContentParameterMetadata.Default, - _ => Assumed.Unreachable($"Unexpected MetadataKind '{metadataKind}'."), - }; - + var metadata = ReadMetadata(reader, nameof(BoundAttributeDescriptor.Metadata)); var diagnostics = reader.ReadImmutableArrayOrEmpty(nameof(BoundAttributeDescriptor.Diagnostics), ReadDiagnostic); return new BoundAttributeDescriptor( flags, name!, propertyName, typeNameObject, indexerNamePrefix, indexerTypeNameObject, documentationObject, displayName, containingType, - parameters, metadataObject, diagnostics); + parameters, metadata, diagnostics); } } @@ -154,12 +145,29 @@ static TypeNameObject ReadTypeNameObject(JsonDataReader reader, string propertyN return default; } + if (reader.TryReadNull()) + { + return default; + } + if (reader.IsInteger) { var index = reader.ReadByte(); return new(index); } + if (reader.IsObjectStart) + { + return reader.ReadNonNullObject(static reader => + { + var fullName = reader.ReadNonNullString(nameof(TypeNameObject.FullName)); + var namespaceName = reader.ReadStringOrNull(nameof(TypeNameObject.Namespace)); + var name = reader.ReadStringOrNull(nameof(TypeNameObject.Name)); + + return TypeNameObject.From(fullName, namespaceName, name); + }); + } + Debug.Assert(reader.IsString); var fullName = reader.ReadNonNullString(); @@ -210,24 +218,22 @@ static DocumentationObject ReadCore(JsonDataReader reader) } } - static MetadataCollection ReadMetadata(JsonDataReader reader, string propertyName) + static MetadataObject ReadMetadata(JsonDataReader reader, string propertyName) { - return reader.TryReadPropertyName(propertyName) - ? reader.ReadNonNullObject(ReadFromProperties) - : MetadataCollection.Empty; + var metadataKind = (MetadataKind)reader.ReadByteOrDefault(WellKnownPropertyNames.MetadataKind, defaultValue: (byte)MetadataKind.None); - static MetadataCollection ReadFromProperties(JsonDataReader reader) + return metadataKind switch { - using var builder = new MetadataBuilder(); - - while (reader.TryReadNextPropertyName(out var key)) - { - var value = reader.ReadString(); - builder.Add(key, value); - } - - return builder.Build(); - } + MetadataKind.None => MetadataObject.None, + MetadataKind.TypeParameter => reader.ReadNonNullObjectOrDefault(propertyName, ReadTypeParameterMetadata, defaultValue: TypeParameterMetadata.Default), + MetadataKind.Property => reader.ReadNonNullObjectOrDefault(propertyName, ReadPropertyMetadata, defaultValue: PropertyMetadata.Default), + MetadataKind.ChildContentParameter => ChildContentParameterMetadata.Default, + MetadataKind.Bind => reader.ReadNonNullObjectOrDefault(propertyName, ReadBindMetadata, defaultValue: BindMetadata.Default), + MetadataKind.Component => reader.ReadNonNullObjectOrDefault(propertyName, ReadComponentMetadata, defaultValue: ComponentMetadata.Default), + MetadataKind.EventHandler => reader.ReadNonNullObject(propertyName, ReadEventHandlerMetadata), + MetadataKind.ViewComponent => reader.ReadNonNullObject(propertyName, ReadViewComponentMetadata), + _ => Assumed.Unreachable($"Unexpected MetadataKind '{metadataKind}'."), + }; } static TypeParameterMetadata ReadTypeParameterMetadata(JsonDataReader reader) @@ -257,5 +263,52 @@ static PropertyMetadata ReadPropertyMetadata(JsonDataReader reader) return builder.Build(); } + + static BindMetadata ReadBindMetadata(JsonDataReader reader) + { + var builder = new BindMetadata.Builder + { + IsFallback = reader.ReadBooleanOrFalse(nameof(BindMetadata.IsFallback)), + ValueAttribute = reader.ReadStringOrNull(nameof(BindMetadata.ValueAttribute)), + ChangeAttribute = reader.ReadStringOrNull(nameof(BindMetadata.ChangeAttribute)), + ExpressionAttribute = reader.ReadStringOrNull(nameof(BindMetadata.ExpressionAttribute)), + TypeAttribute = reader.ReadStringOrNull(nameof(BindMetadata.TypeAttribute)), + IsInvariantCulture = reader.ReadBooleanOrFalse(nameof(BindMetadata.IsInvariantCulture)), + Format = reader.ReadStringOrNull(nameof(BindMetadata.Format)) + }; + + return builder.Build(); + } + } + + static ComponentMetadata ReadComponentMetadata(JsonDataReader reader) + { + var builder = new ComponentMetadata.Builder + { + IsGeneric = reader.ReadBooleanOrFalse(nameof(ComponentMetadata.IsGeneric)), + HasRenderModeDirective = reader.ReadBooleanOrFalse(nameof(ComponentMetadata.HasRenderModeDirective)) + }; + + return builder.Build(); + } + + static EventHandlerMetadata ReadEventHandlerMetadata(JsonDataReader reader) + { + var builder = new EventHandlerMetadata.Builder + { + EventArgsType = reader.ReadNonNullString(nameof(EventHandlerMetadata.EventArgsType)) + }; + + return builder.Build(); + } + + static ViewComponentMetadata ReadViewComponentMetadata(JsonDataReader reader) + { + var builder = new ViewComponentMetadata.Builder + { + Name = reader.ReadNonNullString(nameof(ViewComponentMetadata.Name)) + }; + + return builder.Build(); } } diff --git a/src/RazorSdk/Tool/Json/ObjectWriters_TagHelpers.cs b/src/RazorSdk/Tool/Json/ObjectWriters_TagHelpers.cs index 4c4b5972c379..cd5e9554a2e1 100644 --- a/src/RazorSdk/Tool/Json/ObjectWriters_TagHelpers.cs +++ b/src/RazorSdk/Tool/Json/ObjectWriters_TagHelpers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using Microsoft.AspNetCore.Mvc.Razor.Extensions; using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Components; @@ -14,13 +15,15 @@ public static void Write(JsonDataWriter writer, TagHelperDescriptor? value) public static void WriteProperties(JsonDataWriter writer, TagHelperDescriptor value) { - writer.Write(nameof(value.Kind), value.Kind); + writer.Write(nameof(value.Flags), (byte)value.Flags); + writer.WriteIfNotDefault(nameof(value.Kind), (byte)value.Kind, defaultValue: (byte)TagHelperKind.Component); + writer.WriteIfNotDefault(nameof(value.RuntimeKind), (byte)value.RuntimeKind, defaultValue: (byte)RuntimeKind.IComponent); writer.Write(nameof(value.Name), value.Name); writer.Write(nameof(value.AssemblyName), value.AssemblyName); writer.WriteIfNotNull(nameof(value.DisplayName), value.DisplayName); + WriteTypeNameObject(writer, nameof(value.TypeName), value.TypeNameObject); WriteDocumentationObject(writer, nameof(value.Documentation), value.DocumentationObject); writer.WriteIfNotNull(nameof(value.TagOutputHint), value.TagOutputHint); - writer.Write(nameof(value.CaseSensitive), value.CaseSensitive); writer.WriteArrayIfNotDefaultOrEmpty(nameof(value.TagMatchingRules), value.TagMatchingRules, WriteTagMatchingRule); writer.WriteArrayIfNotDefaultOrEmpty(nameof(value.BoundAttributes), value.BoundAttributes, WriteBoundAttribute); writer.WriteArrayIfNotDefaultOrEmpty(nameof(value.AllowedChildTags), value.AllowedChildTags, WriteAllowedChildTag); @@ -57,15 +60,32 @@ static void WriteDocumentationObject(JsonDataWriter writer, string propertyName, } } - static void WriteTypeNameObject(JsonDataWriter writer, string propertyName, TypeNameObject typeNameObject) + static void WriteTypeNameObject(JsonDataWriter writer, string propertyName, TypeNameObject value) { - if (typeNameObject.Index is byte index) + if (value.IsNull) + { + // Don't write property if the value is null. + } + else if (value.Index is byte index) { writer.Write(propertyName, index); } - else if (typeNameObject.StringValue is string stringValue) + else if (value.Namespace is null && value.Name is null) { - writer.Write(propertyName, stringValue); + // If we only have a full name, write that. + writer.Write(propertyName, value.FullName.AssumeNotNull()); + } + else + { + writer.WriteObject(propertyName, value, static (writer, value) => + { + Debug.Assert(value.Index is null); + + writer.Write(nameof(value.FullName), value.FullName); + writer.WriteIfNotNull(nameof(value.Namespace), value.Namespace); + writer.WriteIfNotNull(nameof(value.Name), value.Name); + }); + } } @@ -110,7 +130,7 @@ static void WriteBoundAttribute(JsonDataWriter writer, BoundAttributeDescriptor WriteDocumentationObject(writer, nameof(value.Documentation), value.DocumentationObject); writer.WriteArrayIfNotDefaultOrEmpty(nameof(value.Parameters), value.Parameters, WriteBoundAttributeParameter); - WriteMetadataObject(writer, nameof(value.Metadata), value.Metadata.AssumeNotNull()); + WriteMetadata(writer, nameof(value.Metadata), value.Metadata); writer.WriteArrayIfNotDefaultOrEmpty(nameof(value.Diagnostics), value.Diagnostics, Write); }); @@ -140,35 +160,18 @@ static void WriteAllowedChildTag(JsonDataWriter writer, AllowedChildTagDescripto }); } - static void WriteMetadata(JsonDataWriter writer, string propertyName, MetadataCollection metadata) - { - // If there isn't any metadata, don't write the property. - if (metadata.Count == 0) - { - return; - } - - writer.WriteObject(propertyName, metadata, static (writer, metadata) => - { - foreach (var (key, value) in metadata) - { - writer.Write(key, value); - } - }); - } - - static void WriteMetadataObject(JsonDataWriter writer, string propertyName, MetadataObject metadata) + static void WriteMetadata(JsonDataWriter writer, string propertyName, MetadataObject metadata) { if (metadata.Kind is MetadataKind.None) { return; } - writer.Write("MetadataKind", (byte)metadata.Kind); + writer.Write(WellKnownPropertyNames.MetadataKind, (byte)metadata.Kind); - if (metadata.Kind is MetadataKind.ChildContentParameter) + if (metadata.HasDefaultValue) { - // No properties to write for ChildContentParameterMetadata. + // No properties to write. return; } @@ -184,6 +187,22 @@ static void WriteMetadataObject(JsonDataWriter writer, string propertyName, Meta WritePropertyMetadata(writer, (PropertyMetadata)value); break; + case MetadataKind.Bind: + WriteBindMetadata(writer, (BindMetadata)value); + break; + + case MetadataKind.Component: + WriteComponentMetadata(writer, (ComponentMetadata)value); + break; + + case MetadataKind.EventHandler: + WriteEventHandlerMetadata(writer, (EventHandlerMetadata)value); + break; + + case MetadataKind.ViewComponent: + WriteViewComponentMetadata(writer, (ViewComponentMetadata)value); + break; + default: Debug.Fail($"Unsupported metadata kind '{value.Kind}'."); break; @@ -207,6 +226,33 @@ static void WritePropertyMetadata(JsonDataWriter writer, PropertyMetadata metada writer.WriteIfNotFalse(nameof(metadata.IsGenericTyped), metadata.IsGenericTyped); writer.WriteIfNotFalse(nameof(metadata.IsInitOnlyProperty), metadata.IsInitOnlyProperty); } + + static void WriteBindMetadata(JsonDataWriter writer, BindMetadata metadata) + { + writer.WriteIfNotFalse(nameof(metadata.IsFallback), metadata.IsFallback); + writer.WriteIfNotNull(nameof(metadata.ValueAttribute), metadata.ValueAttribute); + writer.WriteIfNotNull(nameof(metadata.ChangeAttribute), metadata.ChangeAttribute); + writer.WriteIfNotNull(nameof(metadata.ExpressionAttribute), metadata.ExpressionAttribute); + writer.WriteIfNotNull(nameof(metadata.TypeAttribute), metadata.TypeAttribute); + writer.WriteIfNotFalse(nameof(metadata.IsInvariantCulture), metadata.IsInvariantCulture); + writer.WriteIfNotNull(nameof(metadata.Format), metadata.Format); + } + + static void WriteComponentMetadata(JsonDataWriter writer, ComponentMetadata metadata) + { + writer.WriteIfNotFalse(nameof(metadata.IsGeneric), metadata.IsGeneric); + writer.WriteIfNotFalse(nameof(metadata.HasRenderModeDirective), metadata.HasRenderModeDirective); + } + + static void WriteEventHandlerMetadata(JsonDataWriter writer, EventHandlerMetadata metadata) + { + writer.Write(nameof(metadata.EventArgsType), metadata.EventArgsType); + } + + static void WriteViewComponentMetadata(JsonDataWriter writer, ViewComponentMetadata metadata) + { + writer.Write(nameof(metadata.Name), metadata.Name); + } } } } diff --git a/src/RazorSdk/Tool/Json/WellKnownPropertyNames.cs b/src/RazorSdk/Tool/Json/WellKnownPropertyNames.cs index 8fadc3daa37f..c33c5bfe93c8 100644 --- a/src/RazorSdk/Tool/Json/WellKnownPropertyNames.cs +++ b/src/RazorSdk/Tool/Json/WellKnownPropertyNames.cs @@ -6,4 +6,5 @@ namespace Microsoft.NET.Sdk.Razor.Tool.Json; internal static class WellKnownPropertyNames { public const string Message = "Message"; + public const string MetadataKind = "MetadataKind"; } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index acb871529a97..80ee1d1f6f06 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#nullable disable + using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Microsoft.DotNet.Cli; @@ -19,19 +21,18 @@ namespace Microsoft.NET.Build.Tasks /// public class ProcessFrameworkReferences : TaskBase { - public string? TargetFrameworkIdentifier { get; set; } + public string TargetFrameworkIdentifier { get; set; } - [Required] - public string TargetFrameworkVersion { get; set; } = null!; + public string TargetFrameworkVersion { get; set; } - public string? TargetPlatformIdentifier { get; set; } + public string TargetPlatformIdentifier { get; set; } - public string? TargetPlatformVersion { get; set; } + public string TargetPlatformVersion { get; set; } - public string? TargetingPackRoot { get; set; } + public string TargetingPackRoot { get; set; } [Required] - public string RuntimeGraphPath { get; set; } = null!; + public string RuntimeGraphPath { get; set; } public bool SelfContained { get; set; } @@ -47,45 +48,39 @@ public class ProcessFrameworkReferences : TaskBase public bool SilenceIsAotCompatibleUnsupportedWarning { get; set; } - public string? MinNonEolTargetFrameworkForAot { get; set; } + public string MinNonEolTargetFrameworkForAot { get; set; } public bool EnableAotAnalyzer { get; set; } - public string? FirstTargetFrameworkVersionToSupportAotAnalyzer { get; set; } + public string FirstTargetFrameworkVersionToSupportAotAnalyzer { get; set; } public bool PublishTrimmed { get; set; } public bool IsTrimmable { get; set; } - public string? FirstTargetFrameworkVersionToSupportTrimAnalyzer { get; set; } + public string FirstTargetFrameworkVersionToSupportTrimAnalyzer { get; set; } public bool SilenceIsTrimmableUnsupportedWarning { get; set; } - public string? MinNonEolTargetFrameworkForTrimming { get; set; } + public string MinNonEolTargetFrameworkForTrimming { get; set; } public bool EnableTrimAnalyzer { get; set; } public bool EnableSingleFileAnalyzer { get; set; } - public string? FirstTargetFrameworkVersionToSupportSingleFileAnalyzer { get; set; } + public string FirstTargetFrameworkVersionToSupportSingleFileAnalyzer { get; set; } public bool SilenceEnableSingleFileAnalyzerUnsupportedWarning { get; set; } - public string? MinNonEolTargetFrameworkForSingleFile { get; set; } + public string MinNonEolTargetFrameworkForSingleFile { get; set; } public bool AotUseKnownRuntimePackForTarget { get; set; } - public string? RuntimeIdentifier { get; set; } - - /// - /// Since this Target is mostly focused on managing RID-specific assets, we massage the 'any' RID (which is platform-agnostic) into a 'null' - /// value to make processing simpler. - /// - public string? EffectiveRuntimeIdentifier => RuntimeIdentifier == "any" ? null : RuntimeIdentifier; + public string RuntimeIdentifier { get; set; } - public string[]? RuntimeIdentifiers { get; set; } + public string[] RuntimeIdentifiers { get; set; } - public string? RuntimeFrameworkVersion { get; set; } + public string RuntimeFrameworkVersion { get; set; } public bool TargetLatestRuntimePatch { get; set; } @@ -120,48 +115,48 @@ public class ProcessFrameworkReferences : TaskBase public bool RequiresAspNetWebAssets { get; set; } [Required] - public string NETCoreSdkRuntimeIdentifier { get; set; } = null!; + public string NETCoreSdkRuntimeIdentifier { get; set; } - public string? NETCoreSdkPortableRuntimeIdentifier { get; set; } + public string NETCoreSdkPortableRuntimeIdentifier { get; set; } [Required] - public string NetCoreRoot { get; set; } = null!; + public string NetCoreRoot { get; set; } [Required] - public string NETCoreSdkVersion { get; set; } = null!; + public string NETCoreSdkVersion { get; set; } [Output] - public ITaskItem[]? PackagesToDownload { get; set; } + public ITaskItem[] PackagesToDownload { get; set; } [Output] - public ITaskItem[]? RuntimeFrameworks { get; set; } + public ITaskItem[] RuntimeFrameworks { get; set; } [Output] - public ITaskItem[]? TargetingPacks { get; set; } + public ITaskItem[] TargetingPacks { get; set; } [Output] - public ITaskItem[]? RuntimePacks { get; set; } + public ITaskItem[] RuntimePacks { get; set; } [Output] - public ITaskItem[]? Crossgen2Packs { get; set; } + public ITaskItem[] Crossgen2Packs { get; set; } [Output] - public ITaskItem[]? HostILCompilerPacks { get; set; } + public ITaskItem[] HostILCompilerPacks { get; set; } [Output] - public ITaskItem[]? TargetILCompilerPacks { get; set; } + public ITaskItem[] TargetILCompilerPacks { get; set; } [Output] - public ITaskItem[]? ImplicitPackageReferences { get; set; } + public ITaskItem[] ImplicitPackageReferences { get; set; } // Runtime packs which aren't available for the specified RuntimeIdentifier [Output] - public ITaskItem[]? UnavailableRuntimePacks { get; set; } + public ITaskItem[] UnavailableRuntimePacks { get; set; } [Output] - public string[]? KnownRuntimeIdentifierPlatforms { get; set; } + public string[] KnownRuntimeIdentifierPlatforms { get; set; } - private Version? _normalizedTargetFrameworkVersion; + private Version _normalizedTargetFrameworkVersion; void AddPacksForFrameworkReferences( List packagesToDownload, @@ -177,6 +172,7 @@ out List knownRuntimePacksForTargetFramework .Select(item => new KnownFrameworkReference(item)) .Where(kfr => KnownFrameworkReferenceAppliesToTargetFramework(kfr.TargetFramework)) .ToList(); + // Get known runtime packs from known framework references. // Only use items where the framework reference name matches the RuntimeFrameworkName. // This will filter out known framework references for "profiles", ie WindowsForms and WPF @@ -192,15 +188,13 @@ out List knownRuntimePacksForTargetFramework .Where(krp => KnownFrameworkReferenceAppliesToTargetFramework(krp.TargetFramework))); var frameworkReferenceMap = FrameworkReferences.ToDictionary(fr => fr.ItemSpec, StringComparer.OrdinalIgnoreCase); - Log.LogMessage(MessageImportance.Low, $"Found {frameworkReferenceMap.Count} known framework references for target framework {TargetFrameworkIdentifier}"); - Log.LogMessage(MessageImportance.Low, $"Found {knownRuntimePacksForTargetFramework.Count} known runtime packs for target framework {TargetFrameworkIdentifier}"); HashSet unrecognizedRuntimeIdentifiers = new(StringComparer.OrdinalIgnoreCase); bool windowsOnlyErrorLogged = false; foreach (var knownFrameworkReference in knownFrameworkReferencesForTargetFramework) { - frameworkReferenceMap.TryGetValue(knownFrameworkReference.Name, out ITaskItem? frameworkReference); + frameworkReferenceMap.TryGetValue(knownFrameworkReference.Name, out ITaskItem frameworkReference); // Handle Windows-only frameworks on non-Windows platforms if (knownFrameworkReference.IsWindowsOnly && @@ -213,7 +207,7 @@ out List knownRuntimePacksForTargetFramework Log.LogError(Strings.WindowsDesktopFrameworkRequiresWindows); windowsOnlyErrorLogged = true; } - Log.LogMessage(MessageImportance.Low, $"Ignoring framework reference to {knownFrameworkReference.Name} as it is Windows-only and the current platform is not Windows."); + // Ignore (and don't download) this known framework reference as it requires Windows continue; } @@ -222,34 +216,27 @@ out List knownRuntimePacksForTargetFramework // Add targeting pack and all known runtime packs to "preferred packages" list. // These are packages that will win in conflict resolution for assets that have identical assembly and file versions - var preferredPackages = new HashSet(StringComparer.InvariantCultureIgnoreCase) - { - knownFrameworkReference.TargetingPackName - }; + var preferredPackages = new HashSet(StringComparer.InvariantCultureIgnoreCase); + preferredPackages.Add(knownFrameworkReference.TargetingPackName); - if (selectedRuntimePack is KnownRuntimePack selectedPack) + if (selectedRuntimePack != null) { - var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedPack.RuntimePackRuntimeIdentifiers.Split(';'); + var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedRuntimePack?.RuntimePackRuntimeIdentifiers.Split(';'); foreach (var runtimeIdentifier in knownFrameworkReferenceRuntimePackRuntimeIdentifiers) { - foreach (var runtimePackNamePattern in selectedPack.RuntimePackNamePatterns.Split(';')) + foreach (var runtimePackNamePattern in selectedRuntimePack?.RuntimePackNamePatterns.Split(';')) { string runtimePackName = runtimePackNamePattern.Replace("**RID**", runtimeIdentifier); preferredPackages.Add(runtimePackName); } } - Log.LogMessage(MessageImportance.Low, $"Selected {selectedPack.Name} with RIDs '{selectedPack.RuntimePackRuntimeIdentifiers}'"); - } - else - { - Log.LogMessage(MessageImportance.Low, $"No runtime pack found for {knownFrameworkReference.Name}."); } TaskItem targetingPack = new(knownFrameworkReference.Name); targetingPack.SetMetadata(MetadataKeys.NuGetPackageId, knownFrameworkReference.TargetingPackName); targetingPack.SetMetadata(MetadataKeys.PackageConflictPreferredPackages, string.Join(";", preferredPackages)); - string? targetingPackVersion = null; + string targetingPackVersion = null; if (frameworkReference != null) { // Allow targeting pack version to be overridden via metadata on FrameworkReference @@ -278,7 +265,7 @@ out List knownRuntimePacksForTargetFramework } // Get the path of the targeting pack in the targeting pack root (e.g. dotnet/packs) - string? targetingPackPath = GetPackPath(knownFrameworkReference.TargetingPackName, targetingPackVersion); + string targetingPackPath = GetPackPath(knownFrameworkReference.TargetingPackName, targetingPackVersion); if (targetingPackPath != null) { // Use targeting pack from packs folder @@ -302,15 +289,13 @@ out List knownRuntimePacksForTargetFramework targetingPacks.Add(targetingPack); - Log.LogMessage(MessageImportance.Low, $"Selected targeting pack '{targetingPack.ItemSpec}@{targetingPackVersion}'"); - - string runtimeFrameworkVersion = GetRuntimeFrameworkVersion( + var runtimeFrameworkVersion = GetRuntimeFrameworkVersion( frameworkReference, knownFrameworkReference, selectedRuntimePack, out string runtimePackVersion); - string? isTrimmable = null; + string isTrimmable = null; if (frameworkReference != null) { // Allow IsTrimmable to be overridden via metadata on FrameworkReference @@ -323,7 +308,7 @@ out List knownRuntimePacksForTargetFramework bool useRuntimePackAndDownloadIfNecessary; KnownRuntimePack runtimePackForRuntimeIDProcessing; - if (knownFrameworkReference.Name.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase) && selectedRuntimePack != null) + if (knownFrameworkReference.Name.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase)) { // Only add runtime packs where the framework reference name matches the RuntimeFrameworkName // Framework references for "profiles" will use the runtime pack from the corresponding non-profile framework @@ -349,25 +334,28 @@ out List knownRuntimePacksForTargetFramework selectedRuntimePack != null && selectedRuntimePack.Value.RuntimePackAlwaysCopyLocal; var runtimeRequiredByDeployment = (SelfContained || ReadyToRunEnabled) && - !string.IsNullOrEmpty(EffectiveRuntimeIdentifier) && - !string.IsNullOrEmpty(selectedRuntimePack?.RuntimePackNamePatterns); + !string.IsNullOrEmpty(RuntimeIdentifier) && + selectedRuntimePack != null && + !string.IsNullOrEmpty(selectedRuntimePack.Value.RuntimePackNamePatterns); if (hasRuntimePackAlwaysCopyLocal || runtimeRequiredByDeployment) { // Find other KnownFrameworkReferences that map to the same runtime pack, if any - List? additionalFrameworkReferencesForRuntimePack = null; + List additionalFrameworkReferencesForRuntimePack = null; foreach (var additionalKnownFrameworkReference in knownFrameworkReferencesForTargetFramework) { if (additionalKnownFrameworkReference.RuntimeFrameworkName.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase) && !additionalKnownFrameworkReference.RuntimeFrameworkName.Equals(additionalKnownFrameworkReference.Name, StringComparison.OrdinalIgnoreCase)) { - additionalFrameworkReferencesForRuntimePack ??= []; + if (additionalFrameworkReferencesForRuntimePack == null) + { + additionalFrameworkReferencesForRuntimePack = new List(); + } additionalFrameworkReferencesForRuntimePack.Add(additionalKnownFrameworkReference.Name); } } - // Process primary runtime identifier - ProcessRuntimeIdentifier(EffectiveRuntimeIdentifier ?? "any", runtimePackForRuntimeIDProcessing, runtimePackVersion, additionalFrameworkReferencesForRuntimePack, + ProcessRuntimeIdentifier(string.IsNullOrEmpty(RuntimeIdentifier) ? "any" : RuntimeIdentifier, runtimePackForRuntimeIDProcessing, runtimePackVersion, additionalFrameworkReferencesForRuntimePack, unrecognizedRuntimeIdentifiers, unavailableRuntimePacks, runtimePacks, packagesToDownload, isTrimmable, useRuntimePackAndDownloadIfNecessary, wasReferencedDirectly: frameworkReference != null); @@ -378,19 +366,12 @@ var runtimeRequiredByDeployment { foreach (var runtimeIdentifier in RuntimeIdentifiers) { - if (processedPrimaryRuntimeIdentifier && runtimeIdentifier == EffectiveRuntimeIdentifier) + if (processedPrimaryRuntimeIdentifier && runtimeIdentifier == RuntimeIdentifier) { // We've already processed this RID continue; } - if (runtimeIdentifier == "any") - { - // The `any` RID represents a platform-agnostic target. As such, it has no - // platform-specific runtime pack associated with it. - continue; - } - // Pass in null for the runtimePacks list, as for these runtime identifiers we only want to // download the runtime packs, but not use the assets from them ProcessRuntimeIdentifier(runtimeIdentifier, runtimePackForRuntimeIDProcessing, runtimePackVersion, additionalFrameworkReferencesForRuntimePack: null, @@ -408,19 +389,18 @@ var runtimeRequiredByDeployment runtimeFramework.SetMetadata("Profile", knownFrameworkReference.Profile); runtimeFrameworks.Add(runtimeFramework); - Log.LogMessage(MessageImportance.Low, $"Added runtime framework '{runtimeFramework.ItemSpec}@{runtimeFrameworkVersion}'"); } } } protected override void ExecuteCore() { - List? packagesToDownload = null; - List? runtimeFrameworks = null; - List? targetingPacks = null; - List? runtimePacks = null; - List? unavailableRuntimePacks = null; - List? knownRuntimePacksForTargetFramework = null; + List packagesToDownload = null; + List runtimeFrameworks = null; + List targetingPacks = null; + List runtimePacks = null; + List unavailableRuntimePacks = null; + List knownRuntimePacksForTargetFramework = null; // Perf optimization: If there are no FrameworkReference items, then don't do anything // (This means that if you don't have any direct framework references, you won't get any transitive ones either @@ -466,8 +446,8 @@ protected override void ExecuteCore() case ToolPackSupport.UnsupportedForHostRuntimeIdentifier: Log.LogError(Strings.AotUnsupportedHostRuntimeIdentifier, NETCoreSdkRuntimeIdentifier); return; - case ToolPackSupport.UnsupportedForTargetRuntimeIdentifier when EffectiveRuntimeIdentifier != null: - Log.LogError(Strings.AotUnsupportedTargetRuntimeIdentifier, EffectiveRuntimeIdentifier!); + case ToolPackSupport.UnsupportedForTargetRuntimeIdentifier: + Log.LogError(Strings.AotUnsupportedTargetRuntimeIdentifier, RuntimeIdentifier); return; case ToolPackSupport.Supported: break; @@ -489,7 +469,7 @@ protected override void ExecuteCore() else if (IsAotCompatible || EnableAotAnalyzer) { if (!SilenceIsAotCompatibleUnsupportedWarning) - Log.LogWarning(Strings.IsAotCompatibleUnsupported, MinNonEolTargetFrameworkForAot!); + Log.LogWarning(Strings.IsAotCompatibleUnsupported, MinNonEolTargetFrameworkForAot); } else if (PublishTrimmed) { @@ -498,14 +478,14 @@ protected override void ExecuteCore() else if (IsTrimmable || EnableTrimAnalyzer) { if (!SilenceIsTrimmableUnsupportedWarning) - Log.LogWarning(Strings.IsTrimmableUnsupported, MinNonEolTargetFrameworkForTrimming!); + Log.LogWarning(Strings.IsTrimmableUnsupported, MinNonEolTargetFrameworkForTrimming); } else if (EnableSingleFileAnalyzer) { // There's no IsSingleFileCompatible setting. EnableSingleFileAnalyzer is the // recommended way to ensure single-file compatibility for libraries. if (!SilenceEnableSingleFileAnalyzerUnsupportedWarning) - Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported, MinNonEolTargetFrameworkForSingleFile!); + Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported, MinNonEolTargetFrameworkForSingleFile); } else { @@ -614,11 +594,11 @@ private bool KnownFrameworkReferenceAppliesToTargetFramework(NuGetFramework know return true; } - private KnownRuntimePack? SelectRuntimePack(ITaskItem? frameworkReference, KnownFrameworkReference knownFrameworkReference, List knownRuntimePacks) + private KnownRuntimePack? SelectRuntimePack(ITaskItem frameworkReference, KnownFrameworkReference knownFrameworkReference, List knownRuntimePacks) { var requiredLabelsMetadata = frameworkReference?.GetMetadata(MetadataKeys.RuntimePackLabels) ?? ""; - HashSet? requiredRuntimePackLabels = null; + HashSet requiredRuntimePackLabels = null; if (frameworkReference != null) { requiredRuntimePackLabels = new HashSet(requiredLabelsMetadata.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); @@ -663,20 +643,20 @@ private void ProcessRuntimeIdentifier( string runtimeIdentifier, KnownRuntimePack selectedRuntimePack, string runtimePackVersion, - List? additionalFrameworkReferencesForRuntimePack, + List additionalFrameworkReferencesForRuntimePack, HashSet unrecognizedRuntimeIdentifiers, List unavailableRuntimePacks, - List? runtimePacks, + List runtimePacks, List packagesToDownload, - string? isTrimmable, + string isTrimmable, bool addRuntimePackAndDownloadIfNecessary, bool wasReferencedDirectly) { var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedRuntimePack.RuntimePackRuntimeIdentifiers.Split(';'); var knownFrameworkReferenceRuntimePackExcludedRuntimeIdentifiers = selectedRuntimePack.RuntimePackExcludedRuntimeIdentifiers.Split(';'); - Log.LogMessage(MessageImportance.Low, $"Finding best RID match for pack {selectedRuntimePack.Name}@{runtimePackVersion} for target RID '{runtimeIdentifier}' from '{selectedRuntimePack.RuntimePackRuntimeIdentifiers}' excluding '{selectedRuntimePack.RuntimePackExcludedRuntimeIdentifiers}'"); - string? runtimePackRuntimeIdentifier = NuGetUtils.GetBestMatchingRidWithExclusion( + + string runtimePackRuntimeIdentifier = NuGetUtils.GetBestMatchingRidWithExclusion( runtimeGraph, runtimeIdentifier, knownFrameworkReferenceRuntimePackExcludedRuntimeIdentifiers, @@ -712,7 +692,7 @@ private void ProcessRuntimeIdentifier( // Look up runtimePackVersion from workload manifests if necessary string resolvedRuntimePackVersion = GetResolvedPackVersion(runtimePackName, runtimePackVersion); - string? runtimePackPath = GetPackPath(runtimePackName, resolvedRuntimePackVersion); + string runtimePackPath = GetPackPath(runtimePackName, resolvedRuntimePackVersion); if (runtimePacks != null) { @@ -787,7 +767,6 @@ private ToolPackSupport AddToolPack( ToolPackType.AspNetCore => KnownAspNetCorePacks, _ => throw new ArgumentException($"Unknown package type {toolPackType}", nameof(toolPackType)) }; - Log.LogMessage(MessageImportance.Low, $"Adding tool pack {toolPackType} for runtime {normalizedTargetFrameworkVersion}"); var knownPack = knownPacks.Where(pack => { @@ -808,39 +787,50 @@ private ToolPackSupport AddToolPack( packVersion = RuntimeFrameworkVersion; } - Log.LogMessage(MessageImportance.Low, $"Found {toolPackType} pack '{knownPack.ItemSpec}@{packVersion}'"); - - TaskItem? runtimePackToDownload = null; + TaskItem runtimePackToDownload = null; // Crossgen and ILCompiler have RID-specific bits. if (toolPackType is ToolPackType.Crossgen2 or ToolPackType.ILCompiler) { var packNamePattern = knownPack.GetMetadata(packName + "PackNamePattern"); var packSupportedRuntimeIdentifiers = knownPack.GetMetadata(packName + "RuntimeIdentifiers").Split(';'); - // When publishing for the non-portable RID that matches NETCoreSdkRuntimeIdentifier, prefer NETCoreSdkRuntimeIdentifier for the host. + var packSupportedPortableRuntimeIdentifiers = knownPack.GetMetadata(packName + "PortableRuntimeIdentifiers").Split(';'); + + // When publishing for a non-portable RID, prefer NETCoreSdkRuntimeIdentifier for the host. // Otherwise prefer the NETCoreSdkPortableRuntimeIdentifier. - // This makes non-portable SDKs behave the same as portable SDKs except for the specific case of targetting the non-portable RID. - // It also enables the non-portable ILCompiler to be packaged separately from the SDK and - // only required when publishing for the non-portable SDK RID. + // This makes non-portable SDKs behave the same as portable SDKs except for the specific case of targetting a non-portable RID. + // This ensures that targeting portable RIDs doesn't require any non-portable assets that aren't packaged in the SDK. + // Due to size concerns, the non-portable ILCompiler and Crossgen2 aren't included by default in non-portable SDK distributions. string portableSdkRid = !string.IsNullOrEmpty(NETCoreSdkPortableRuntimeIdentifier) ? NETCoreSdkPortableRuntimeIdentifier : NETCoreSdkRuntimeIdentifier; - bool targetsNonPortableSdkRid = EffectiveRuntimeIdentifier == NETCoreSdkRuntimeIdentifier && NETCoreSdkRuntimeIdentifier != portableSdkRid; - string? hostRuntimeIdentifier = targetsNonPortableSdkRid ? NETCoreSdkRuntimeIdentifier : portableSdkRid; - Log.LogMessage(MessageImportance.Low, $"Determining best RID for '{knownPack.ItemSpec}@{packVersion}' for '{hostRuntimeIdentifier}' from among '{knownPack.GetMetadata(packName + "RuntimeIdentifiers")}'"); - // Get the best RID for the host machine, which will be used to validate that we can run crossgen for the target platform and architecture + var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); - hostRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(runtimeGraph, hostRuntimeIdentifier, packSupportedRuntimeIdentifiers, out bool wasInGraph); + + // Prefer portable when the "supported RID" for the tool pack is the same RID as the "supported portable RID". + // This makes non-portable SDKs behave the same as portable SDKs except for the specific cases added to "supported", such as targeting the non-portable RID. + // This also ensures that targeting common RIDs doesn't require any non-portable assets that aren't packaged in the SDK by default. + // Due to size concerns, the non-portable ILCompiler and Crossgen2 aren't included by default in non-portable SDK distributions. + string supportedTargetRid = NuGetUtils.GetBestMatchingRid(runtimeGraph, RuntimeIdentifier, packSupportedRuntimeIdentifiers, out _); + string supportedPortableTargetRid = NuGetUtils.GetBestMatchingRid(runtimeGraph, RuntimeIdentifier, packSupportedPortableRuntimeIdentifiers, out _); + + bool usePortable = !string.IsNullOrEmpty(NETCoreSdkPortableRuntimeIdentifier) && supportedTargetRid == supportedPortableTargetRid; + + // Get the best RID for the host machine, which will be used to validate that we can run crossgen for the target platform and architecture + string hostRuntimeIdentifier = usePortable + ? NuGetUtils.GetBestMatchingRid(runtimeGraph, NETCoreSdkPortableRuntimeIdentifier, packSupportedPortableRuntimeIdentifiers, out _) + : NuGetUtils.GetBestMatchingRid(runtimeGraph, NETCoreSdkRuntimeIdentifier, packSupportedRuntimeIdentifiers, out _); + if (hostRuntimeIdentifier == null) { return ToolPackSupport.UnsupportedForHostRuntimeIdentifier; } - Log.LogMessage(MessageImportance.Low, $"Best RID for '{knownPack.ItemSpec}@{packVersion}' is '{hostRuntimeIdentifier}'"); + var runtimePackName = packNamePattern.Replace("**RID**", hostRuntimeIdentifier); var runtimePackItem = new TaskItem(runtimePackName); runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName); runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion); - string? runtimePackPath = GetPackPath(runtimePackName, packVersion); + string runtimePackPath = GetPackPath(runtimePackName, packVersion); if (runtimePackPath != null) { runtimePackItem.SetMetadata(MetadataKeys.PackageDirectory, runtimePackPath); @@ -853,7 +843,6 @@ private ToolPackSupport AddToolPack( } runtimePackItem.SetMetadata(MetadataKeys.RuntimeIdentifier, hostRuntimeIdentifier); - Log.LogMessage(MessageImportance.Low, $"Added {toolPackType} runtime pack '{runtimePackName}@{packVersion}'"); switch (toolPackType) { @@ -864,10 +853,9 @@ private ToolPackSupport AddToolPack( // ILCompiler supports cross target compilation. If there is a cross-target request, // we need to download that package as well unless we use KnownRuntimePack entries for the target. // We expect RuntimeIdentifier to be defined during publish but can allow during build - if (EffectiveRuntimeIdentifier != null && !AotUseKnownRuntimePackForTarget) + if (RuntimeIdentifier != null && !AotUseKnownRuntimePackForTarget) { - Log.LogMessage(MessageImportance.Low, $"Checking for cross-targeting compilation packs"); - var targetRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(runtimeGraph, EffectiveRuntimeIdentifier, packSupportedRuntimeIdentifiers, out bool wasInGraph2); + var targetRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(runtimeGraph, RuntimeIdentifier, packSupportedRuntimeIdentifiers, out bool wasInGraph2); if (targetRuntimeIdentifier == null) { return ToolPackSupport.UnsupportedForTargetRuntimeIdentifier; @@ -889,9 +877,8 @@ private ToolPackSupport AddToolPack( targetIlcPack.SetMetadata(MetadataKeys.NuGetPackageId, targetIlcPackName); targetIlcPack.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion); TargetILCompilerPacks = new[] { targetIlcPack }; - Log.LogMessage(MessageImportance.Low, $"Added {targetIlcPackName}@{packVersion} for cross-targeting compilation"); - string? targetILCompilerPackPath = GetPackPath(targetIlcPackName, packVersion); + string targetILCompilerPackPath = GetPackPath(targetIlcPackName, packVersion); if (targetILCompilerPackPath != null) { targetIlcPack.SetMetadata(MetadataKeys.PackageDirectory, targetILCompilerPackPath); @@ -904,10 +891,6 @@ private ToolPackSupport AddToolPack( packagesToDownload.Add(targetIlcPackToDownload); } } - else - { - Log.LogMessage(MessageImportance.Low, $"No cross-targeting compilation packs required."); - } } HostILCompilerPacks = new[] { runtimePackItem }; @@ -925,36 +908,20 @@ private ToolPackSupport AddToolPack( // The ILLink tool pack is available for some TargetFrameworks where we nonetheless consider // IsTrimmable/IsAotCompatible/EnableSingleFile to be unsupported, because the framework // was not annotated with the attributes. - if (FirstTargetFrameworkVersionToSupportAotAnalyzer != null) - { - var firstTargetFrameworkVersionToSupportAotAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportAotAnalyzer)); - if ((IsAotCompatible || EnableAotAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportAotAnalyzer) - { - return ToolPackSupport.UnsupportedForTargetFramework; - } - } - if (FirstTargetFrameworkVersionToSupportSingleFileAnalyzer != null) - { - var firstTargetFrameworkVersionToSupportSingleFileAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportSingleFileAnalyzer)); - if (EnableSingleFileAnalyzer && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportSingleFileAnalyzer) - { - return ToolPackSupport.UnsupportedForTargetFramework; - } - } - if (FirstTargetFrameworkVersionToSupportTrimAnalyzer != null) - { - var firstTargetFrameworkVersionToSupportTrimAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportTrimAnalyzer)); - if ((IsTrimmable || EnableTrimAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportTrimAnalyzer) - { - return ToolPackSupport.UnsupportedForTargetFramework; - } - } + var firstTargetFrameworkVersionToSupportAotAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportAotAnalyzer)); + if ((IsAotCompatible || EnableAotAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportAotAnalyzer) + return ToolPackSupport.UnsupportedForTargetFramework; + var firstTargetFrameworkVersionToSupportSingleFileAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportSingleFileAnalyzer)); + if (EnableSingleFileAnalyzer && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportSingleFileAnalyzer) + return ToolPackSupport.UnsupportedForTargetFramework; + var firstTargetFrameworkVersionToSupportTrimAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportTrimAnalyzer)); + if ((IsTrimmable || EnableTrimAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportTrimAnalyzer) + return ToolPackSupport.UnsupportedForTargetFramework; } // Packs with RID-agnostic build packages that contain MSBuild targets. if (toolPackType is not ToolPackType.Crossgen2 && EnableRuntimePackDownload) { - Log.LogMessage(MessageImportance.Low, $"Added {knownPack.ItemSpec}@{packVersion} for build-time targets"); var buildPackageName = knownPack.ItemSpec; var buildPackage = new TaskItem(buildPackageName); buildPackage.SetMetadata(MetadataKeys.Version, packVersion); @@ -972,14 +939,13 @@ private ToolPackSupport AddToolPack( var analyzerPackage = new TaskItem("Microsoft.NET.ILLink.Analyzers"); analyzerPackage.SetMetadata(MetadataKeys.Version, packVersion); implicitPackageReferences.Add(analyzerPackage); - Log.LogMessage(MessageImportance.Low, $"Added {analyzerPackage.ItemSpec}@{packVersion} for linker analyzers"); } return ToolPackSupport.Supported; } private string GetRuntimeFrameworkVersion( - ITaskItem? frameworkReference, + ITaskItem frameworkReference, KnownFrameworkReference knownFrameworkReference, KnownRuntimePack? knownRuntimePack, out string runtimePackVersion) @@ -993,7 +959,7 @@ private string GetRuntimeFrameworkVersion( // - But, if TargetLatestRuntimePatch was defaulted and not overridden by user, then acquire latest runtime pack for future // self-contained deployment (or for crossgen of framework-dependent deployment), while targeting the default version. - string? requestedVersion = GetRequestedRuntimeFrameworkVersion(frameworkReference); + string requestedVersion = GetRequestedRuntimeFrameworkVersion(frameworkReference); if (!string.IsNullOrEmpty(requestedVersion)) { runtimePackVersion = requestedVersion; @@ -1007,10 +973,10 @@ private string GetRuntimeFrameworkVersion( return knownFrameworkReference.DefaultRuntimeFrameworkVersion; case RuntimePatchRequest.UseLatestVersion: - if (knownRuntimePack is KnownRuntimePack knownPack) + if (knownRuntimePack != null) { - runtimePackVersion = knownPack.LatestRuntimeFrameworkVersion; - return knownPack.LatestRuntimeFrameworkVersion; + runtimePackVersion = knownRuntimePack?.LatestRuntimeFrameworkVersion; + return knownRuntimePack?.LatestRuntimeFrameworkVersion; } else { @@ -1018,9 +984,9 @@ private string GetRuntimeFrameworkVersion( return knownFrameworkReference.DefaultRuntimeFrameworkVersion; } case RuntimePatchRequest.UseDefaultVersionWithLatestRuntimePack: - if (knownRuntimePack is KnownRuntimePack knownPack2) + if (knownRuntimePack != null) { - runtimePackVersion = knownPack2.LatestRuntimeFrameworkVersion; + runtimePackVersion = knownRuntimePack?.LatestRuntimeFrameworkVersion; } else { @@ -1034,7 +1000,7 @@ private string GetRuntimeFrameworkVersion( } } - private string? GetPackPath(string packName, string packVersion) + private string GetPackPath(string packName, string packVersion) { IEnumerable GetPackFolders() { @@ -1074,14 +1040,8 @@ IEnumerable GetPackFolders() return null; } - Lazy _workloadResolver - { - get - { - field ??= LazyCreateWorkloadResolver(); - return field; - } - } + SdkDirectoryWorkloadManifestProvider _workloadManifestProvider; + WorkloadResolver _workloadResolver; private string GetResolvedPackVersion(string packID, string packVersion) { @@ -1090,7 +1050,19 @@ private string GetResolvedPackVersion(string packID, string packVersion) return packVersion; } - var packInfo = _workloadResolver.Value.TryGetPackInfo(new WorkloadPackId(packID)); + if (_workloadManifestProvider == null) + { + string userProfileDir = CliFolderPathCalculatorCore.GetDotnetUserProfileFolderPath(); + + // When running MSBuild tasks, the current directory is always the project directory, so we can use that as the + // starting point to search for global.json + string globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory); + + _workloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(NetCoreRoot, NETCoreSdkVersion, userProfileDir, globalJsonPath); + _workloadResolver = WorkloadResolver.Create(_workloadManifestProvider, NetCoreRoot, NETCoreSdkVersion, userProfileDir); + } + + var packInfo = _workloadResolver.TryGetPackInfo(new WorkloadPackId(packID)); if (packInfo == null) { Log.LogError(Strings.CouldNotGetPackVersionFromWorkloadManifests, packID); @@ -1099,21 +1071,6 @@ private string GetResolvedPackVersion(string packID, string packVersion) return packInfo.Version; } - private Lazy LazyCreateWorkloadResolver() - { - return new(() => - { - string? userProfileDir = CliFolderPathCalculatorCore.GetDotnetUserProfileFolderPath(); - - // When running MSBuild tasks, the current directory is always the project directory, so we can use that as the - // starting point to search for global.json - string? globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory); - - var manifestProvider = new SdkDirectoryWorkloadManifestProvider(NetCoreRoot, NETCoreSdkVersion, userProfileDir, globalJsonPath); - return WorkloadResolver.Create(manifestProvider, NetCoreRoot, NETCoreSdkVersion, userProfileDir); - }); - } - private enum RuntimePatchRequest { UseDefaultVersionWithLatestRuntimePack, @@ -1127,7 +1084,7 @@ private enum RuntimePatchRequest /// private class PackageToDownloadComparer : IEqualityComparer where T : ITaskItem { - public bool Equals(T? x, T? y) + public bool Equals(T x, T y) { if (x is null || y is null) { @@ -1149,9 +1106,9 @@ public int GetHashCode(T obj) } } - private RuntimePatchRequest GetRuntimePatchRequest(ITaskItem? frameworkReference) + private RuntimePatchRequest GetRuntimePatchRequest(ITaskItem frameworkReference) { - string? value = frameworkReference?.GetMetadata("TargetLatestRuntimePatch"); + string value = frameworkReference?.GetMetadata("TargetLatestRuntimePatch"); if (!string.IsNullOrEmpty(value)) { return MSBuildUtilities.ConvertStringToBool(value, defaultValue: false) @@ -1169,9 +1126,9 @@ private RuntimePatchRequest GetRuntimePatchRequest(ITaskItem? frameworkReference : RuntimePatchRequest.UseDefaultVersion; } - private string? GetRequestedRuntimeFrameworkVersion(ITaskItem? frameworkReference) + private string GetRequestedRuntimeFrameworkVersion(ITaskItem frameworkReference) { - string? requestedVersion = frameworkReference?.GetMetadata("RuntimeFrameworkVersion"); + string requestedVersion = frameworkReference?.GetMetadata("RuntimeFrameworkVersion"); if (string.IsNullOrEmpty(requestedVersion)) { From 26d921714ae636fd3db74f55a395db9bcaf1874f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 25 Sep 2025 02:19:44 +0000 Subject: [PATCH 2/3] Update dependencies from https://github.com/dotnet/dotnet build 284548 Updated Dependencies: dotnet-dev-certs, dotnet-user-jwts, dotnet-user-secrets, Microsoft.AspNetCore.Analyzers, Microsoft.AspNetCore.App.Ref, Microsoft.AspNetCore.App.Ref.Internal, Microsoft.AspNetCore.Authentication.Facebook, Microsoft.AspNetCore.Authentication.Google, Microsoft.AspNetCore.Authentication.MicrosoftAccount, Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Components, Microsoft.AspNetCore.Components.Analyzers, Microsoft.AspNetCore.Components.Forms, Microsoft.AspNetCore.Components.SdkAnalyzers, Microsoft.AspNetCore.Components.Web, Microsoft.AspNetCore.Components.WebAssembly, Microsoft.AspNetCore.Components.WebAssembly.Server, Microsoft.AspNetCore.Components.WebView, Microsoft.AspNetCore.DeveloperCertificates.XPlat, Microsoft.AspNetCore.Metadata, Microsoft.AspNetCore.Mvc.Analyzers, Microsoft.AspNetCore.Mvc.Api.Analyzers, Microsoft.AspNetCore.TestHost, Microsoft.Bcl.AsyncInterfaces, Microsoft.DotNet.Web.ItemTemplates.10.0, Microsoft.DotNet.Web.ProjectTemplates.10.0, Microsoft.Extensions.Configuration.Ini, Microsoft.Extensions.DependencyModel, Microsoft.Extensions.FileProviders.Abstractions, Microsoft.Extensions.FileProviders.Embedded, Microsoft.Extensions.FileSystemGlobbing, Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Abstractions, Microsoft.Extensions.Logging.Console, Microsoft.Extensions.ObjectPool, Microsoft.JSInterop, Microsoft.NET.HostModel, Microsoft.NET.ILLink.Tasks, Microsoft.NET.Runtime.Emscripten.3.1.56.Cache.win-x64, Microsoft.NET.Sdk.WindowsDesktop, Microsoft.NETCore.App.Ref, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, Microsoft.WindowsDesktop.App.Internal, Microsoft.WindowsDesktop.App.Ref, System.CodeDom, System.ComponentModel.Composition, System.Composition.AttributedModel, System.Composition.Convention, System.Composition.Hosting, System.Composition.Runtime, System.Composition.TypedParts, System.Configuration.ConfigurationManager, System.Diagnostics.DiagnosticSource, System.Formats.Asn1, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Security.Cryptography.Pkcs, System.Security.Cryptography.ProtectedData, System.Security.Cryptography.Xml, System.Security.Permissions, System.ServiceProcess.ServiceController, System.Text.Encoding.CodePages, System.Text.Json, System.Windows.Extensions (Version 10.0.0-rc.1.25469.103 -> 10.0.0-rc.1.25474.105) Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal, Microsoft.CodeAnalysis.Razor.Tooling.Internal, Microsoft.NET.Sdk.Razor.SourceGenerators.Transport (Version 10.0.0-preview.25469.103 -> 10.0.0-preview.25474.105) Microsoft.Build, Microsoft.Build.Localization, Microsoft.NET.Test.Sdk, Microsoft.TestPlatform.Build, Microsoft.TestPlatform.CLI (Version 18.0.0-preview-25469-103 -> 18.0.0-preview-25474-105) Microsoft.Build.NuGetSdkResolver, NuGet.Build.Tasks, NuGet.Build.Tasks.Console, NuGet.Build.Tasks.Pack, NuGet.CommandLine.XPlat, NuGet.Commands, NuGet.Common, NuGet.Configuration, NuGet.Credentials, NuGet.DependencyResolver.Core, NuGet.Frameworks, NuGet.LibraryModel, NuGet.Localization, NuGet.Packaging, NuGet.ProjectModel, NuGet.Protocol, NuGet.Versioning (Version 7.0.0-preview.1.47003 -> 7.0.0-preview.1.47505) Microsoft.Build.Tasks.Git, Microsoft.SourceLink.AzureRepos.Git, Microsoft.SourceLink.Bitbucket.Git, Microsoft.SourceLink.Common, Microsoft.SourceLink.GitHub, Microsoft.SourceLink.GitLab (Version 10.0.0-beta.25469.103 -> 10.0.0-beta.25474.105) Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.BuildClient, Microsoft.CodeAnalysis.CSharp, Microsoft.CodeAnalysis.CSharp.CodeStyle, Microsoft.CodeAnalysis.CSharp.Features, Microsoft.CodeAnalysis.CSharp.Workspaces, Microsoft.CodeAnalysis.PublicApiAnalyzers, Microsoft.CodeAnalysis.Workspaces.Common, Microsoft.CodeAnalysis.Workspaces.MSBuild, Microsoft.Net.Compilers.Toolset, Microsoft.Net.Compilers.Toolset.Framework (Version 5.0.0-2.25469.103 -> 5.0.0-2.25474.105) Microsoft.Deployment.DotNet.Releases (Version 2.0.0-preview.1.25469.103 -> 2.0.0-preview.1.25474.105) Microsoft.DiaSymReader (Version 2.2.0-beta.25469.103 -> 2.2.0-beta.25474.105) Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Installers, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Build.Tasks.Workloads, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.SignTool, Microsoft.DotNet.XliffTasks, Microsoft.DotNet.XUnitExtensions (Version 11.0.0-beta.25469.103 -> 11.0.0-beta.25474.105) Microsoft.FSharp.Compiler (Version 14.0.100-rc2.25469.103 -> 14.0.100-rc2.25474.105) Microsoft.TemplateEngine.Abstractions, Microsoft.TemplateEngine.Authoring.TemplateVerifier, Microsoft.TemplateEngine.Edge, Microsoft.TemplateEngine.Mocks, Microsoft.TemplateEngine.Orchestrator.RunnableProjects, Microsoft.TemplateEngine.TestHelper, Microsoft.TemplateEngine.Utils, Microsoft.TemplateSearch.Common, Microsoft.TemplateSearch.TemplateDiscovery (Version 11.0.100-alpha.1.25469.103 -> 11.0.100-alpha.1.25474.105) Microsoft.Web.Xdt (Version 3.2.0-preview.25469.103 -> 3.2.0-preview.25474.105) System.CommandLine (Version 2.0.0-rc.1.25469.103 -> 2.0.0-rc.1.25474.105) Microsoft.Testing.Platform (Version 1.9.0-preview.25470.1 -> 1.9.0-preview.25466.2) MSTest (Version 3.11.0-preview.25470.1 -> 3.11.0-preview.25466.2) --- eng/Version.Details.props | 264 +++++++++---------- eng/Version.Details.xml | 530 +++++++++++++++++++------------------- global.json | 4 +- 3 files changed, 399 insertions(+), 399 deletions(-) diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 3c3759599738..0ae9e1d1003d 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,142 +6,142 @@ This file should be imported by eng/Versions.props - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-preview.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 18.0.0-preview-25469-103 - 18.0.0-preview-25469-103 - 7.0.0-preview.1.47003 - 10.0.0-beta.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 10.0.0-preview.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 2.0.0-preview.1.25469.103 - 2.2.0-beta.25469.103 - 11.0.0-beta.25469.103 - 11.0.0-beta.25469.103 - 11.0.0-beta.25469.103 - 11.0.0-beta.25469.103 - 11.0.0-beta.25469.103 - 11.0.0-beta.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 11.0.0-beta.25469.103 - 11.0.0-beta.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 14.0.100-rc2.25469.103 - 10.0.0-rc.1.25469.103 - 5.0.0-2.25469.103 - 5.0.0-2.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-preview.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 18.0.0-preview-25474-105 + 18.0.0-preview-25474-105 + 7.0.0-preview.1.47505 + 10.0.0-beta.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 10.0.0-preview.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 2.0.0-preview.1.25474.105 + 2.2.0-beta.25474.105 + 11.0.0-beta.25474.105 + 11.0.0-beta.25474.105 + 11.0.0-beta.25474.105 + 11.0.0-beta.25474.105 + 11.0.0-beta.25474.105 + 11.0.0-beta.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 11.0.0-beta.25474.105 + 11.0.0-beta.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 14.0.100-rc2.25474.105 + 10.0.0-rc.1.25474.105 + 5.0.0-2.25474.105 + 5.0.0-2.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 10.0.0-preview.7.25377.103 - 10.0.0-preview.25469.103 - 10.0.0-rc.1.25469.103 - 18.0.0-preview-25469-103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-beta.25469.103 - 10.0.0-beta.25469.103 - 10.0.0-beta.25469.103 - 10.0.0-beta.25469.103 - 10.0.0-beta.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 11.0.100-alpha.1.25469.103 - 18.0.0-preview-25469-103 - 18.0.0-preview-25469-103 - 3.2.0-preview.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 7.0.0-preview.1.47003 - 10.0.0-rc.1.25469.103 - 2.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 - 10.0.0-rc.1.25469.103 + 10.0.0-preview.25474.105 + 10.0.0-rc.1.25474.105 + 18.0.0-preview-25474-105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-beta.25474.105 + 10.0.0-beta.25474.105 + 10.0.0-beta.25474.105 + 10.0.0-beta.25474.105 + 10.0.0-beta.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 11.0.100-alpha.1.25474.105 + 18.0.0-preview-25474-105 + 18.0.0-preview-25474-105 + 3.2.0-preview.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 7.0.0-preview.1.47505 + 10.0.0-rc.1.25474.105 + 2.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 + 10.0.0-rc.1.25474.105 2.1.0 - 1.9.0-preview.25470.1 - 3.11.0-preview.25470.1 + 1.9.0-preview.25466.2 + 3.11.0-preview.25466.2 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bcb1d1b06d9b..f164e9b39968 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,62 +1,62 @@ - + - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 @@ -68,170 +68,170 @@ https://github.com/dotnet/dotnet 6a953e76162f3f079405f80e28664fa51b136740 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 - + https://github.com/microsoft/testfx - 7812bf1fe7289e9f528ced8a230502c1e0bfe50f + 3f63086ec67feb7f98d964e989ec5d8fdc4a3a01 - + https://github.com/microsoft/testfx - 7812bf1fe7289e9f528ced8a230502c1e0bfe50f + 3f63086ec67feb7f98d964e989ec5d8fdc4a3a01 - + https://github.com/dotnet/dotnet - 992bd27d60fa0ee11af65c89b31d71dc9ca7e18e + a0ca1b9be44fcdffcc9f6a0d6a1f3dca62d1b3f3 diff --git a/global.json b/global.json index d7a67b7aecb8..d2c9b5392dd7 100644 --- a/global.json +++ b/global.json @@ -21,8 +21,8 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25469.103", - "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.25469.103", + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25474.105", + "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.25474.105", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.WixToolset.Sdk": "5.0.2-dotnet.2737382" From 5e8e5149c2839c1fee5ee4cc3cc5bf4a3a1109de Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 26 Sep 2025 14:13:11 -0700 Subject: [PATCH 3/3] Manually revert changes to ProcessFrameworkReferences.cs. --- .../ProcessFrameworkReferences.cs | 323 ++++++++++-------- 1 file changed, 183 insertions(+), 140 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index 80ee1d1f6f06..191dbdaeee48 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -1,8 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#nullable disable - using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Microsoft.DotNet.Cli; @@ -21,18 +19,19 @@ namespace Microsoft.NET.Build.Tasks /// public class ProcessFrameworkReferences : TaskBase { - public string TargetFrameworkIdentifier { get; set; } + public string? TargetFrameworkIdentifier { get; set; } - public string TargetFrameworkVersion { get; set; } + [Required] + public string TargetFrameworkVersion { get; set; } = null!; - public string TargetPlatformIdentifier { get; set; } + public string? TargetPlatformIdentifier { get; set; } - public string TargetPlatformVersion { get; set; } + public string? TargetPlatformVersion { get; set; } - public string TargetingPackRoot { get; set; } + public string? TargetingPackRoot { get; set; } [Required] - public string RuntimeGraphPath { get; set; } + public string RuntimeGraphPath { get; set; } = null!; public bool SelfContained { get; set; } @@ -48,39 +47,45 @@ public class ProcessFrameworkReferences : TaskBase public bool SilenceIsAotCompatibleUnsupportedWarning { get; set; } - public string MinNonEolTargetFrameworkForAot { get; set; } + public string? MinNonEolTargetFrameworkForAot { get; set; } public bool EnableAotAnalyzer { get; set; } - public string FirstTargetFrameworkVersionToSupportAotAnalyzer { get; set; } + public string? FirstTargetFrameworkVersionToSupportAotAnalyzer { get; set; } public bool PublishTrimmed { get; set; } public bool IsTrimmable { get; set; } - public string FirstTargetFrameworkVersionToSupportTrimAnalyzer { get; set; } + public string? FirstTargetFrameworkVersionToSupportTrimAnalyzer { get; set; } public bool SilenceIsTrimmableUnsupportedWarning { get; set; } - public string MinNonEolTargetFrameworkForTrimming { get; set; } + public string? MinNonEolTargetFrameworkForTrimming { get; set; } public bool EnableTrimAnalyzer { get; set; } public bool EnableSingleFileAnalyzer { get; set; } - public string FirstTargetFrameworkVersionToSupportSingleFileAnalyzer { get; set; } + public string? FirstTargetFrameworkVersionToSupportSingleFileAnalyzer { get; set; } public bool SilenceEnableSingleFileAnalyzerUnsupportedWarning { get; set; } - public string MinNonEolTargetFrameworkForSingleFile { get; set; } + public string? MinNonEolTargetFrameworkForSingleFile { get; set; } public bool AotUseKnownRuntimePackForTarget { get; set; } - public string RuntimeIdentifier { get; set; } + public string? RuntimeIdentifier { get; set; } + + /// + /// Since this Target is mostly focused on managing RID-specific assets, we massage the 'any' RID (which is platform-agnostic) into a 'null' + /// value to make processing simpler. + /// + public string? EffectiveRuntimeIdentifier => RuntimeIdentifier == "any" ? null : RuntimeIdentifier; - public string[] RuntimeIdentifiers { get; set; } + public string[]? RuntimeIdentifiers { get; set; } - public string RuntimeFrameworkVersion { get; set; } + public string? RuntimeFrameworkVersion { get; set; } public bool TargetLatestRuntimePatch { get; set; } @@ -115,48 +120,48 @@ public class ProcessFrameworkReferences : TaskBase public bool RequiresAspNetWebAssets { get; set; } [Required] - public string NETCoreSdkRuntimeIdentifier { get; set; } + public string NETCoreSdkRuntimeIdentifier { get; set; } = null!; - public string NETCoreSdkPortableRuntimeIdentifier { get; set; } + public string? NETCoreSdkPortableRuntimeIdentifier { get; set; } [Required] - public string NetCoreRoot { get; set; } + public string NetCoreRoot { get; set; } = null!; [Required] - public string NETCoreSdkVersion { get; set; } + public string NETCoreSdkVersion { get; set; } = null!; [Output] - public ITaskItem[] PackagesToDownload { get; set; } + public ITaskItem[]? PackagesToDownload { get; set; } [Output] - public ITaskItem[] RuntimeFrameworks { get; set; } + public ITaskItem[]? RuntimeFrameworks { get; set; } [Output] - public ITaskItem[] TargetingPacks { get; set; } + public ITaskItem[]? TargetingPacks { get; set; } [Output] - public ITaskItem[] RuntimePacks { get; set; } + public ITaskItem[]? RuntimePacks { get; set; } [Output] - public ITaskItem[] Crossgen2Packs { get; set; } + public ITaskItem[]? Crossgen2Packs { get; set; } [Output] - public ITaskItem[] HostILCompilerPacks { get; set; } + public ITaskItem[]? HostILCompilerPacks { get; set; } [Output] - public ITaskItem[] TargetILCompilerPacks { get; set; } + public ITaskItem[]? TargetILCompilerPacks { get; set; } [Output] - public ITaskItem[] ImplicitPackageReferences { get; set; } + public ITaskItem[]? ImplicitPackageReferences { get; set; } // Runtime packs which aren't available for the specified RuntimeIdentifier [Output] - public ITaskItem[] UnavailableRuntimePacks { get; set; } + public ITaskItem[]? UnavailableRuntimePacks { get; set; } [Output] - public string[] KnownRuntimeIdentifierPlatforms { get; set; } + public string[]? KnownRuntimeIdentifierPlatforms { get; set; } - private Version _normalizedTargetFrameworkVersion; + private Version? _normalizedTargetFrameworkVersion; void AddPacksForFrameworkReferences( List packagesToDownload, @@ -172,7 +177,6 @@ out List knownRuntimePacksForTargetFramework .Select(item => new KnownFrameworkReference(item)) .Where(kfr => KnownFrameworkReferenceAppliesToTargetFramework(kfr.TargetFramework)) .ToList(); - // Get known runtime packs from known framework references. // Only use items where the framework reference name matches the RuntimeFrameworkName. // This will filter out known framework references for "profiles", ie WindowsForms and WPF @@ -188,13 +192,15 @@ out List knownRuntimePacksForTargetFramework .Where(krp => KnownFrameworkReferenceAppliesToTargetFramework(krp.TargetFramework))); var frameworkReferenceMap = FrameworkReferences.ToDictionary(fr => fr.ItemSpec, StringComparer.OrdinalIgnoreCase); + Log.LogMessage(MessageImportance.Low, $"Found {frameworkReferenceMap.Count} known framework references for target framework {TargetFrameworkIdentifier}"); + Log.LogMessage(MessageImportance.Low, $"Found {knownRuntimePacksForTargetFramework.Count} known runtime packs for target framework {TargetFrameworkIdentifier}"); HashSet unrecognizedRuntimeIdentifiers = new(StringComparer.OrdinalIgnoreCase); bool windowsOnlyErrorLogged = false; foreach (var knownFrameworkReference in knownFrameworkReferencesForTargetFramework) { - frameworkReferenceMap.TryGetValue(knownFrameworkReference.Name, out ITaskItem frameworkReference); + frameworkReferenceMap.TryGetValue(knownFrameworkReference.Name, out ITaskItem? frameworkReference); // Handle Windows-only frameworks on non-Windows platforms if (knownFrameworkReference.IsWindowsOnly && @@ -207,7 +213,7 @@ out List knownRuntimePacksForTargetFramework Log.LogError(Strings.WindowsDesktopFrameworkRequiresWindows); windowsOnlyErrorLogged = true; } - + Log.LogMessage(MessageImportance.Low, $"Ignoring framework reference to {knownFrameworkReference.Name} as it is Windows-only and the current platform is not Windows."); // Ignore (and don't download) this known framework reference as it requires Windows continue; } @@ -216,27 +222,34 @@ out List knownRuntimePacksForTargetFramework // Add targeting pack and all known runtime packs to "preferred packages" list. // These are packages that will win in conflict resolution for assets that have identical assembly and file versions - var preferredPackages = new HashSet(StringComparer.InvariantCultureIgnoreCase); - preferredPackages.Add(knownFrameworkReference.TargetingPackName); + var preferredPackages = new HashSet(StringComparer.InvariantCultureIgnoreCase) + { + knownFrameworkReference.TargetingPackName + }; - if (selectedRuntimePack != null) + if (selectedRuntimePack is KnownRuntimePack selectedPack) { - var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedRuntimePack?.RuntimePackRuntimeIdentifiers.Split(';'); + var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedPack.RuntimePackRuntimeIdentifiers.Split(';'); foreach (var runtimeIdentifier in knownFrameworkReferenceRuntimePackRuntimeIdentifiers) { - foreach (var runtimePackNamePattern in selectedRuntimePack?.RuntimePackNamePatterns.Split(';')) + foreach (var runtimePackNamePattern in selectedPack.RuntimePackNamePatterns.Split(';')) { string runtimePackName = runtimePackNamePattern.Replace("**RID**", runtimeIdentifier); preferredPackages.Add(runtimePackName); } } + Log.LogMessage(MessageImportance.Low, $"Selected {selectedPack.Name} with RIDs '{selectedPack.RuntimePackRuntimeIdentifiers}'"); + } + else + { + Log.LogMessage(MessageImportance.Low, $"No runtime pack found for {knownFrameworkReference.Name}."); } TaskItem targetingPack = new(knownFrameworkReference.Name); targetingPack.SetMetadata(MetadataKeys.NuGetPackageId, knownFrameworkReference.TargetingPackName); targetingPack.SetMetadata(MetadataKeys.PackageConflictPreferredPackages, string.Join(";", preferredPackages)); - string targetingPackVersion = null; + string? targetingPackVersion = null; if (frameworkReference != null) { // Allow targeting pack version to be overridden via metadata on FrameworkReference @@ -265,7 +278,7 @@ out List knownRuntimePacksForTargetFramework } // Get the path of the targeting pack in the targeting pack root (e.g. dotnet/packs) - string targetingPackPath = GetPackPath(knownFrameworkReference.TargetingPackName, targetingPackVersion); + string? targetingPackPath = GetPackPath(knownFrameworkReference.TargetingPackName, targetingPackVersion); if (targetingPackPath != null) { // Use targeting pack from packs folder @@ -289,13 +302,15 @@ out List knownRuntimePacksForTargetFramework targetingPacks.Add(targetingPack); - var runtimeFrameworkVersion = GetRuntimeFrameworkVersion( + Log.LogMessage(MessageImportance.Low, $"Selected targeting pack '{targetingPack.ItemSpec}@{targetingPackVersion}'"); + + string runtimeFrameworkVersion = GetRuntimeFrameworkVersion( frameworkReference, knownFrameworkReference, selectedRuntimePack, out string runtimePackVersion); - string isTrimmable = null; + string? isTrimmable = null; if (frameworkReference != null) { // Allow IsTrimmable to be overridden via metadata on FrameworkReference @@ -308,7 +323,7 @@ out List knownRuntimePacksForTargetFramework bool useRuntimePackAndDownloadIfNecessary; KnownRuntimePack runtimePackForRuntimeIDProcessing; - if (knownFrameworkReference.Name.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase)) + if (knownFrameworkReference.Name.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase) && selectedRuntimePack != null) { // Only add runtime packs where the framework reference name matches the RuntimeFrameworkName // Framework references for "profiles" will use the runtime pack from the corresponding non-profile framework @@ -334,28 +349,25 @@ out List knownRuntimePacksForTargetFramework selectedRuntimePack != null && selectedRuntimePack.Value.RuntimePackAlwaysCopyLocal; var runtimeRequiredByDeployment = (SelfContained || ReadyToRunEnabled) && - !string.IsNullOrEmpty(RuntimeIdentifier) && - selectedRuntimePack != null && - !string.IsNullOrEmpty(selectedRuntimePack.Value.RuntimePackNamePatterns); + !string.IsNullOrEmpty(EffectiveRuntimeIdentifier) && + !string.IsNullOrEmpty(selectedRuntimePack?.RuntimePackNamePatterns); if (hasRuntimePackAlwaysCopyLocal || runtimeRequiredByDeployment) { // Find other KnownFrameworkReferences that map to the same runtime pack, if any - List additionalFrameworkReferencesForRuntimePack = null; + List? additionalFrameworkReferencesForRuntimePack = null; foreach (var additionalKnownFrameworkReference in knownFrameworkReferencesForTargetFramework) { if (additionalKnownFrameworkReference.RuntimeFrameworkName.Equals(knownFrameworkReference.RuntimeFrameworkName, StringComparison.OrdinalIgnoreCase) && !additionalKnownFrameworkReference.RuntimeFrameworkName.Equals(additionalKnownFrameworkReference.Name, StringComparison.OrdinalIgnoreCase)) { - if (additionalFrameworkReferencesForRuntimePack == null) - { - additionalFrameworkReferencesForRuntimePack = new List(); - } + additionalFrameworkReferencesForRuntimePack ??= []; additionalFrameworkReferencesForRuntimePack.Add(additionalKnownFrameworkReference.Name); } } - ProcessRuntimeIdentifier(string.IsNullOrEmpty(RuntimeIdentifier) ? "any" : RuntimeIdentifier, runtimePackForRuntimeIDProcessing, runtimePackVersion, additionalFrameworkReferencesForRuntimePack, + // Process primary runtime identifier + ProcessRuntimeIdentifier(EffectiveRuntimeIdentifier ?? "any", runtimePackForRuntimeIDProcessing, runtimePackVersion, additionalFrameworkReferencesForRuntimePack, unrecognizedRuntimeIdentifiers, unavailableRuntimePacks, runtimePacks, packagesToDownload, isTrimmable, useRuntimePackAndDownloadIfNecessary, wasReferencedDirectly: frameworkReference != null); @@ -366,12 +378,19 @@ var runtimeRequiredByDeployment { foreach (var runtimeIdentifier in RuntimeIdentifiers) { - if (processedPrimaryRuntimeIdentifier && runtimeIdentifier == RuntimeIdentifier) + if (processedPrimaryRuntimeIdentifier && runtimeIdentifier == EffectiveRuntimeIdentifier) { // We've already processed this RID continue; } + if (runtimeIdentifier == "any") + { + // The `any` RID represents a platform-agnostic target. As such, it has no + // platform-specific runtime pack associated with it. + continue; + } + // Pass in null for the runtimePacks list, as for these runtime identifiers we only want to // download the runtime packs, but not use the assets from them ProcessRuntimeIdentifier(runtimeIdentifier, runtimePackForRuntimeIDProcessing, runtimePackVersion, additionalFrameworkReferencesForRuntimePack: null, @@ -389,18 +408,19 @@ var runtimeRequiredByDeployment runtimeFramework.SetMetadata("Profile", knownFrameworkReference.Profile); runtimeFrameworks.Add(runtimeFramework); + Log.LogMessage(MessageImportance.Low, $"Added runtime framework '{runtimeFramework.ItemSpec}@{runtimeFrameworkVersion}'"); } } } protected override void ExecuteCore() { - List packagesToDownload = null; - List runtimeFrameworks = null; - List targetingPacks = null; - List runtimePacks = null; - List unavailableRuntimePacks = null; - List knownRuntimePacksForTargetFramework = null; + List? packagesToDownload = null; + List? runtimeFrameworks = null; + List? targetingPacks = null; + List? runtimePacks = null; + List? unavailableRuntimePacks = null; + List? knownRuntimePacksForTargetFramework = null; // Perf optimization: If there are no FrameworkReference items, then don't do anything // (This means that if you don't have any direct framework references, you won't get any transitive ones either @@ -446,8 +466,8 @@ protected override void ExecuteCore() case ToolPackSupport.UnsupportedForHostRuntimeIdentifier: Log.LogError(Strings.AotUnsupportedHostRuntimeIdentifier, NETCoreSdkRuntimeIdentifier); return; - case ToolPackSupport.UnsupportedForTargetRuntimeIdentifier: - Log.LogError(Strings.AotUnsupportedTargetRuntimeIdentifier, RuntimeIdentifier); + case ToolPackSupport.UnsupportedForTargetRuntimeIdentifier when EffectiveRuntimeIdentifier != null: + Log.LogError(Strings.AotUnsupportedTargetRuntimeIdentifier, EffectiveRuntimeIdentifier!); return; case ToolPackSupport.Supported: break; @@ -469,7 +489,7 @@ protected override void ExecuteCore() else if (IsAotCompatible || EnableAotAnalyzer) { if (!SilenceIsAotCompatibleUnsupportedWarning) - Log.LogWarning(Strings.IsAotCompatibleUnsupported, MinNonEolTargetFrameworkForAot); + Log.LogWarning(Strings.IsAotCompatibleUnsupported, MinNonEolTargetFrameworkForAot!); } else if (PublishTrimmed) { @@ -478,14 +498,14 @@ protected override void ExecuteCore() else if (IsTrimmable || EnableTrimAnalyzer) { if (!SilenceIsTrimmableUnsupportedWarning) - Log.LogWarning(Strings.IsTrimmableUnsupported, MinNonEolTargetFrameworkForTrimming); + Log.LogWarning(Strings.IsTrimmableUnsupported, MinNonEolTargetFrameworkForTrimming!); } else if (EnableSingleFileAnalyzer) { // There's no IsSingleFileCompatible setting. EnableSingleFileAnalyzer is the // recommended way to ensure single-file compatibility for libraries. if (!SilenceEnableSingleFileAnalyzerUnsupportedWarning) - Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported, MinNonEolTargetFrameworkForSingleFile); + Log.LogWarning(Strings.EnableSingleFileAnalyzerUnsupported, MinNonEolTargetFrameworkForSingleFile!); } else { @@ -594,11 +614,11 @@ private bool KnownFrameworkReferenceAppliesToTargetFramework(NuGetFramework know return true; } - private KnownRuntimePack? SelectRuntimePack(ITaskItem frameworkReference, KnownFrameworkReference knownFrameworkReference, List knownRuntimePacks) + private KnownRuntimePack? SelectRuntimePack(ITaskItem? frameworkReference, KnownFrameworkReference knownFrameworkReference, List knownRuntimePacks) { var requiredLabelsMetadata = frameworkReference?.GetMetadata(MetadataKeys.RuntimePackLabels) ?? ""; - HashSet requiredRuntimePackLabels = null; + HashSet? requiredRuntimePackLabels = null; if (frameworkReference != null) { requiredRuntimePackLabels = new HashSet(requiredLabelsMetadata.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries), StringComparer.OrdinalIgnoreCase); @@ -643,20 +663,20 @@ private void ProcessRuntimeIdentifier( string runtimeIdentifier, KnownRuntimePack selectedRuntimePack, string runtimePackVersion, - List additionalFrameworkReferencesForRuntimePack, + List? additionalFrameworkReferencesForRuntimePack, HashSet unrecognizedRuntimeIdentifiers, List unavailableRuntimePacks, - List runtimePacks, + List? runtimePacks, List packagesToDownload, - string isTrimmable, + string? isTrimmable, bool addRuntimePackAndDownloadIfNecessary, bool wasReferencedDirectly) { var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); var knownFrameworkReferenceRuntimePackRuntimeIdentifiers = selectedRuntimePack.RuntimePackRuntimeIdentifiers.Split(';'); var knownFrameworkReferenceRuntimePackExcludedRuntimeIdentifiers = selectedRuntimePack.RuntimePackExcludedRuntimeIdentifiers.Split(';'); - - string runtimePackRuntimeIdentifier = NuGetUtils.GetBestMatchingRidWithExclusion( + Log.LogMessage(MessageImportance.Low, $"Finding best RID match for pack {selectedRuntimePack.Name}@{runtimePackVersion} for target RID '{runtimeIdentifier}' from '{selectedRuntimePack.RuntimePackRuntimeIdentifiers}' excluding '{selectedRuntimePack.RuntimePackExcludedRuntimeIdentifiers}'"); + string? runtimePackRuntimeIdentifier = NuGetUtils.GetBestMatchingRidWithExclusion( runtimeGraph, runtimeIdentifier, knownFrameworkReferenceRuntimePackExcludedRuntimeIdentifiers, @@ -692,7 +712,7 @@ private void ProcessRuntimeIdentifier( // Look up runtimePackVersion from workload manifests if necessary string resolvedRuntimePackVersion = GetResolvedPackVersion(runtimePackName, runtimePackVersion); - string runtimePackPath = GetPackPath(runtimePackName, resolvedRuntimePackVersion); + string? runtimePackPath = GetPackPath(runtimePackName, resolvedRuntimePackVersion); if (runtimePacks != null) { @@ -767,6 +787,7 @@ private ToolPackSupport AddToolPack( ToolPackType.AspNetCore => KnownAspNetCorePacks, _ => throw new ArgumentException($"Unknown package type {toolPackType}", nameof(toolPackType)) }; + Log.LogMessage(MessageImportance.Low, $"Adding tool pack {toolPackType} for runtime {normalizedTargetFrameworkVersion}"); var knownPack = knownPacks.Where(pack => { @@ -787,50 +808,39 @@ private ToolPackSupport AddToolPack( packVersion = RuntimeFrameworkVersion; } - TaskItem runtimePackToDownload = null; + Log.LogMessage(MessageImportance.Low, $"Found {toolPackType} pack '{knownPack.ItemSpec}@{packVersion}'"); + + TaskItem? runtimePackToDownload = null; // Crossgen and ILCompiler have RID-specific bits. if (toolPackType is ToolPackType.Crossgen2 or ToolPackType.ILCompiler) { var packNamePattern = knownPack.GetMetadata(packName + "PackNamePattern"); var packSupportedRuntimeIdentifiers = knownPack.GetMetadata(packName + "RuntimeIdentifiers").Split(';'); - var packSupportedPortableRuntimeIdentifiers = knownPack.GetMetadata(packName + "PortableRuntimeIdentifiers").Split(';'); - - // When publishing for a non-portable RID, prefer NETCoreSdkRuntimeIdentifier for the host. + // When publishing for the non-portable RID that matches NETCoreSdkRuntimeIdentifier, prefer NETCoreSdkRuntimeIdentifier for the host. // Otherwise prefer the NETCoreSdkPortableRuntimeIdentifier. - // This makes non-portable SDKs behave the same as portable SDKs except for the specific case of targetting a non-portable RID. - // This ensures that targeting portable RIDs doesn't require any non-portable assets that aren't packaged in the SDK. - // Due to size concerns, the non-portable ILCompiler and Crossgen2 aren't included by default in non-portable SDK distributions. + // This makes non-portable SDKs behave the same as portable SDKs except for the specific case of targetting the non-portable RID. + // It also enables the non-portable ILCompiler to be packaged separately from the SDK and + // only required when publishing for the non-portable SDK RID. string portableSdkRid = !string.IsNullOrEmpty(NETCoreSdkPortableRuntimeIdentifier) ? NETCoreSdkPortableRuntimeIdentifier : NETCoreSdkRuntimeIdentifier; - - var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); - - // Prefer portable when the "supported RID" for the tool pack is the same RID as the "supported portable RID". - // This makes non-portable SDKs behave the same as portable SDKs except for the specific cases added to "supported", such as targeting the non-portable RID. - // This also ensures that targeting common RIDs doesn't require any non-portable assets that aren't packaged in the SDK by default. - // Due to size concerns, the non-portable ILCompiler and Crossgen2 aren't included by default in non-portable SDK distributions. - string supportedTargetRid = NuGetUtils.GetBestMatchingRid(runtimeGraph, RuntimeIdentifier, packSupportedRuntimeIdentifiers, out _); - string supportedPortableTargetRid = NuGetUtils.GetBestMatchingRid(runtimeGraph, RuntimeIdentifier, packSupportedPortableRuntimeIdentifiers, out _); - - bool usePortable = !string.IsNullOrEmpty(NETCoreSdkPortableRuntimeIdentifier) && supportedTargetRid == supportedPortableTargetRid; - + bool targetsNonPortableSdkRid = EffectiveRuntimeIdentifier == NETCoreSdkRuntimeIdentifier && NETCoreSdkRuntimeIdentifier != portableSdkRid; + string? hostRuntimeIdentifier = targetsNonPortableSdkRid ? NETCoreSdkRuntimeIdentifier : portableSdkRid; + Log.LogMessage(MessageImportance.Low, $"Determining best RID for '{knownPack.ItemSpec}@{packVersion}' for '{hostRuntimeIdentifier}' from among '{knownPack.GetMetadata(packName + "RuntimeIdentifiers")}'"); // Get the best RID for the host machine, which will be used to validate that we can run crossgen for the target platform and architecture - string hostRuntimeIdentifier = usePortable - ? NuGetUtils.GetBestMatchingRid(runtimeGraph, NETCoreSdkPortableRuntimeIdentifier, packSupportedPortableRuntimeIdentifiers, out _) - : NuGetUtils.GetBestMatchingRid(runtimeGraph, NETCoreSdkRuntimeIdentifier, packSupportedRuntimeIdentifiers, out _); - + var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); + hostRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(runtimeGraph, hostRuntimeIdentifier, packSupportedRuntimeIdentifiers, out bool wasInGraph); if (hostRuntimeIdentifier == null) { return ToolPackSupport.UnsupportedForHostRuntimeIdentifier; } - + Log.LogMessage(MessageImportance.Low, $"Best RID for '{knownPack.ItemSpec}@{packVersion}' is '{hostRuntimeIdentifier}'"); var runtimePackName = packNamePattern.Replace("**RID**", hostRuntimeIdentifier); var runtimePackItem = new TaskItem(runtimePackName); runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName); runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion); - string runtimePackPath = GetPackPath(runtimePackName, packVersion); + string? runtimePackPath = GetPackPath(runtimePackName, packVersion); if (runtimePackPath != null) { runtimePackItem.SetMetadata(MetadataKeys.PackageDirectory, runtimePackPath); @@ -843,6 +853,7 @@ private ToolPackSupport AddToolPack( } runtimePackItem.SetMetadata(MetadataKeys.RuntimeIdentifier, hostRuntimeIdentifier); + Log.LogMessage(MessageImportance.Low, $"Added {toolPackType} runtime pack '{runtimePackName}@{packVersion}'"); switch (toolPackType) { @@ -853,9 +864,10 @@ private ToolPackSupport AddToolPack( // ILCompiler supports cross target compilation. If there is a cross-target request, // we need to download that package as well unless we use KnownRuntimePack entries for the target. // We expect RuntimeIdentifier to be defined during publish but can allow during build - if (RuntimeIdentifier != null && !AotUseKnownRuntimePackForTarget) + if (EffectiveRuntimeIdentifier != null && !AotUseKnownRuntimePackForTarget) { - var targetRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(runtimeGraph, RuntimeIdentifier, packSupportedRuntimeIdentifiers, out bool wasInGraph2); + Log.LogMessage(MessageImportance.Low, $"Checking for cross-targeting compilation packs"); + var targetRuntimeIdentifier = NuGetUtils.GetBestMatchingRid(runtimeGraph, EffectiveRuntimeIdentifier, packSupportedRuntimeIdentifiers, out bool wasInGraph2); if (targetRuntimeIdentifier == null) { return ToolPackSupport.UnsupportedForTargetRuntimeIdentifier; @@ -877,8 +889,9 @@ private ToolPackSupport AddToolPack( targetIlcPack.SetMetadata(MetadataKeys.NuGetPackageId, targetIlcPackName); targetIlcPack.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion); TargetILCompilerPacks = new[] { targetIlcPack }; + Log.LogMessage(MessageImportance.Low, $"Added {targetIlcPackName}@{packVersion} for cross-targeting compilation"); - string targetILCompilerPackPath = GetPackPath(targetIlcPackName, packVersion); + string? targetILCompilerPackPath = GetPackPath(targetIlcPackName, packVersion); if (targetILCompilerPackPath != null) { targetIlcPack.SetMetadata(MetadataKeys.PackageDirectory, targetILCompilerPackPath); @@ -891,6 +904,10 @@ private ToolPackSupport AddToolPack( packagesToDownload.Add(targetIlcPackToDownload); } } + else + { + Log.LogMessage(MessageImportance.Low, $"No cross-targeting compilation packs required."); + } } HostILCompilerPacks = new[] { runtimePackItem }; @@ -908,20 +925,36 @@ private ToolPackSupport AddToolPack( // The ILLink tool pack is available for some TargetFrameworks where we nonetheless consider // IsTrimmable/IsAotCompatible/EnableSingleFile to be unsupported, because the framework // was not annotated with the attributes. - var firstTargetFrameworkVersionToSupportAotAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportAotAnalyzer)); - if ((IsAotCompatible || EnableAotAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportAotAnalyzer) - return ToolPackSupport.UnsupportedForTargetFramework; - var firstTargetFrameworkVersionToSupportSingleFileAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportSingleFileAnalyzer)); - if (EnableSingleFileAnalyzer && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportSingleFileAnalyzer) - return ToolPackSupport.UnsupportedForTargetFramework; - var firstTargetFrameworkVersionToSupportTrimAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportTrimAnalyzer)); - if ((IsTrimmable || EnableTrimAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportTrimAnalyzer) - return ToolPackSupport.UnsupportedForTargetFramework; + if (FirstTargetFrameworkVersionToSupportAotAnalyzer != null) + { + var firstTargetFrameworkVersionToSupportAotAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportAotAnalyzer)); + if ((IsAotCompatible || EnableAotAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportAotAnalyzer) + { + return ToolPackSupport.UnsupportedForTargetFramework; + } + } + if (FirstTargetFrameworkVersionToSupportSingleFileAnalyzer != null) + { + var firstTargetFrameworkVersionToSupportSingleFileAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportSingleFileAnalyzer)); + if (EnableSingleFileAnalyzer && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportSingleFileAnalyzer) + { + return ToolPackSupport.UnsupportedForTargetFramework; + } + } + if (FirstTargetFrameworkVersionToSupportTrimAnalyzer != null) + { + var firstTargetFrameworkVersionToSupportTrimAnalyzer = NormalizeVersion(new Version(FirstTargetFrameworkVersionToSupportTrimAnalyzer)); + if ((IsTrimmable || EnableTrimAnalyzer) && normalizedTargetFrameworkVersion < firstTargetFrameworkVersionToSupportTrimAnalyzer) + { + return ToolPackSupport.UnsupportedForTargetFramework; + } + } } // Packs with RID-agnostic build packages that contain MSBuild targets. if (toolPackType is not ToolPackType.Crossgen2 && EnableRuntimePackDownload) { + Log.LogMessage(MessageImportance.Low, $"Added {knownPack.ItemSpec}@{packVersion} for build-time targets"); var buildPackageName = knownPack.ItemSpec; var buildPackage = new TaskItem(buildPackageName); buildPackage.SetMetadata(MetadataKeys.Version, packVersion); @@ -939,13 +972,14 @@ private ToolPackSupport AddToolPack( var analyzerPackage = new TaskItem("Microsoft.NET.ILLink.Analyzers"); analyzerPackage.SetMetadata(MetadataKeys.Version, packVersion); implicitPackageReferences.Add(analyzerPackage); + Log.LogMessage(MessageImportance.Low, $"Added {analyzerPackage.ItemSpec}@{packVersion} for linker analyzers"); } return ToolPackSupport.Supported; } private string GetRuntimeFrameworkVersion( - ITaskItem frameworkReference, + ITaskItem? frameworkReference, KnownFrameworkReference knownFrameworkReference, KnownRuntimePack? knownRuntimePack, out string runtimePackVersion) @@ -959,7 +993,7 @@ private string GetRuntimeFrameworkVersion( // - But, if TargetLatestRuntimePatch was defaulted and not overridden by user, then acquire latest runtime pack for future // self-contained deployment (or for crossgen of framework-dependent deployment), while targeting the default version. - string requestedVersion = GetRequestedRuntimeFrameworkVersion(frameworkReference); + string? requestedVersion = GetRequestedRuntimeFrameworkVersion(frameworkReference); if (!string.IsNullOrEmpty(requestedVersion)) { runtimePackVersion = requestedVersion; @@ -973,10 +1007,10 @@ private string GetRuntimeFrameworkVersion( return knownFrameworkReference.DefaultRuntimeFrameworkVersion; case RuntimePatchRequest.UseLatestVersion: - if (knownRuntimePack != null) + if (knownRuntimePack is KnownRuntimePack knownPack) { - runtimePackVersion = knownRuntimePack?.LatestRuntimeFrameworkVersion; - return knownRuntimePack?.LatestRuntimeFrameworkVersion; + runtimePackVersion = knownPack.LatestRuntimeFrameworkVersion; + return knownPack.LatestRuntimeFrameworkVersion; } else { @@ -984,9 +1018,9 @@ private string GetRuntimeFrameworkVersion( return knownFrameworkReference.DefaultRuntimeFrameworkVersion; } case RuntimePatchRequest.UseDefaultVersionWithLatestRuntimePack: - if (knownRuntimePack != null) + if (knownRuntimePack is KnownRuntimePack knownPack2) { - runtimePackVersion = knownRuntimePack?.LatestRuntimeFrameworkVersion; + runtimePackVersion = knownPack2.LatestRuntimeFrameworkVersion; } else { @@ -1000,7 +1034,7 @@ private string GetRuntimeFrameworkVersion( } } - private string GetPackPath(string packName, string packVersion) + private string? GetPackPath(string packName, string packVersion) { IEnumerable GetPackFolders() { @@ -1040,8 +1074,14 @@ IEnumerable GetPackFolders() return null; } - SdkDirectoryWorkloadManifestProvider _workloadManifestProvider; - WorkloadResolver _workloadResolver; + Lazy _workloadResolver + { + get + { + field ??= LazyCreateWorkloadResolver(); + return field; + } + } private string GetResolvedPackVersion(string packID, string packVersion) { @@ -1050,19 +1090,7 @@ private string GetResolvedPackVersion(string packID, string packVersion) return packVersion; } - if (_workloadManifestProvider == null) - { - string userProfileDir = CliFolderPathCalculatorCore.GetDotnetUserProfileFolderPath(); - - // When running MSBuild tasks, the current directory is always the project directory, so we can use that as the - // starting point to search for global.json - string globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory); - - _workloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(NetCoreRoot, NETCoreSdkVersion, userProfileDir, globalJsonPath); - _workloadResolver = WorkloadResolver.Create(_workloadManifestProvider, NetCoreRoot, NETCoreSdkVersion, userProfileDir); - } - - var packInfo = _workloadResolver.TryGetPackInfo(new WorkloadPackId(packID)); + var packInfo = _workloadResolver.Value.TryGetPackInfo(new WorkloadPackId(packID)); if (packInfo == null) { Log.LogError(Strings.CouldNotGetPackVersionFromWorkloadManifests, packID); @@ -1071,6 +1099,21 @@ private string GetResolvedPackVersion(string packID, string packVersion) return packInfo.Version; } + private Lazy LazyCreateWorkloadResolver() + { + return new(() => + { + string? userProfileDir = CliFolderPathCalculatorCore.GetDotnetUserProfileFolderPath(); + + // When running MSBuild tasks, the current directory is always the project directory, so we can use that as the + // starting point to search for global.json + string? globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory); + + var manifestProvider = new SdkDirectoryWorkloadManifestProvider(NetCoreRoot, NETCoreSdkVersion, userProfileDir, globalJsonPath); + return WorkloadResolver.Create(manifestProvider, NetCoreRoot, NETCoreSdkVersion, userProfileDir); + }); + } + private enum RuntimePatchRequest { UseDefaultVersionWithLatestRuntimePack, @@ -1084,7 +1127,7 @@ private enum RuntimePatchRequest /// private class PackageToDownloadComparer : IEqualityComparer where T : ITaskItem { - public bool Equals(T x, T y) + public bool Equals(T? x, T? y) { if (x is null || y is null) { @@ -1106,9 +1149,9 @@ public int GetHashCode(T obj) } } - private RuntimePatchRequest GetRuntimePatchRequest(ITaskItem frameworkReference) + private RuntimePatchRequest GetRuntimePatchRequest(ITaskItem? frameworkReference) { - string value = frameworkReference?.GetMetadata("TargetLatestRuntimePatch"); + string? value = frameworkReference?.GetMetadata("TargetLatestRuntimePatch"); if (!string.IsNullOrEmpty(value)) { return MSBuildUtilities.ConvertStringToBool(value, defaultValue: false) @@ -1126,9 +1169,9 @@ private RuntimePatchRequest GetRuntimePatchRequest(ITaskItem frameworkReference) : RuntimePatchRequest.UseDefaultVersion; } - private string GetRequestedRuntimeFrameworkVersion(ITaskItem frameworkReference) + private string? GetRequestedRuntimeFrameworkVersion(ITaskItem? frameworkReference) { - string requestedVersion = frameworkReference?.GetMetadata("RuntimeFrameworkVersion"); + string? requestedVersion = frameworkReference?.GetMetadata("RuntimeFrameworkVersion"); if (string.IsNullOrEmpty(requestedVersion)) { @@ -1236,4 +1279,4 @@ public KnownRuntimePack(ITaskItem item) public NuGetFramework TargetFramework { get; } } } -} +} \ No newline at end of file