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.
572
572
<KnownILCompilerPack Include="Microsoft.DotNet.ILCompiler"
573
573
TargetFramework="net10.0"
574
574
ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler"
575
+ ILCompilerRuntimePackNamePattern="Microsoft.NETCore.App.Runtime.NativeAOT.**RID**"
575
576
ILCompilerPackVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
576
577
ILCompilerRuntimeIdentifiers="@(ILCompilerSupportedRids, '%3B')"
577
578
/>
Original file line number Diff line number Diff line change @@ -846,9 +846,20 @@ private ToolPackSupport AddToolPack(
846
846
{
847
847
return ToolPackSupport . UnsupportedForTargetRuntimeIdentifier ;
848
848
}
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 ) )
850
861
{
851
- var targetIlcPackName = packNamePattern . Replace ( "**RID**" , targetRuntimeIdentifier ) ;
862
+ var targetIlcPackName = targetPackNamePattern . Replace ( "**RID**" , targetRuntimeIdentifier ) ;
852
863
var targetIlcPack = new TaskItem ( targetIlcPackName ) ;
853
864
targetIlcPack . SetMetadata ( MetadataKeys . NuGetPackageId , targetIlcPackName ) ;
854
865
targetIlcPack . SetMetadata ( MetadataKeys . NuGetPackageVersion , packVersion ) ;
You can’t perform that action at this time.
0 commit comments