File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Installer/redist-installer/targets
Tasks/Microsoft.NET.Build.Tasks Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -572,6 +572,7 @@ Copyright (c) .NET Foundation. All rights reserved.
572572 <KnownILCompilerPack Include="Microsoft.DotNet.ILCompiler"
573573 TargetFramework="net10.0"
574574 ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler"
575+ ILCompilerRuntimePackNamePattern="Microsoft.NETCore.App.Runtime.NativeAOT.**RID**"
575576 ILCompilerPackVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
576577 ILCompilerRuntimeIdentifiers="@(ILCompilerSupportedRids, '%3B')"
577578 />
Original file line number Diff line number Diff line change @@ -846,9 +846,20 @@ private ToolPackSupport AddToolPack(
846846 {
847847 return ToolPackSupport . UnsupportedForTargetRuntimeIdentifier ;
848848 }
849- if ( ! hostRuntimeIdentifier . Equals ( targetRuntimeIdentifier ) )
849+
850+ // If we have a separate pack pattern for the runtime pack,
851+ // we should always use the runtime pack (the host pack may not have the tooling we need for the target).
852+ bool useRuntimePackForAllTargets = false ;
853+ string targetPackNamePattern = packNamePattern ;
854+ if ( knownPack . GetMetadata ( "ILCompilerRuntimePackNamePattern" ) is string runtimePackNamePattern )
855+ {
856+ targetPackNamePattern = runtimePackNamePattern ;
857+ useRuntimePackForAllTargets = true ;
858+ }
859+
860+ if ( useRuntimePackForAllTargets || ! hostRuntimeIdentifier . Equals ( targetRuntimeIdentifier ) )
850861 {
851- var targetIlcPackName = packNamePattern . Replace ( "**RID**" , targetRuntimeIdentifier ) ;
862+ var targetIlcPackName = targetPackNamePattern . Replace ( "**RID**" , targetRuntimeIdentifier ) ;
852863 var targetIlcPack = new TaskItem ( targetIlcPackName ) ;
853864 targetIlcPack . SetMetadata ( MetadataKeys . NuGetPackageId , targetIlcPackName ) ;
854865 targetIlcPack . SetMetadata ( MetadataKeys . NuGetPackageVersion , packVersion ) ;
You can’t perform that action at this time.
0 commit comments