Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<KnownILCompilerPack Include="Microsoft.DotNet.ILCompiler"
TargetFramework="net10.0"
ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler"
ILCompilerRuntimePackNamePattern="Microsoft.NETCore.App.Runtime.NativeAOT.**RID**"
ILCompilerPackVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)"
ILCompilerRuntimeIdentifiers="@(ILCompilerSupportedRids, '%3B')"
/>
Expand Down
15 changes: 13 additions & 2 deletions src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,20 @@ private ToolPackSupport AddToolPack(
{
return ToolPackSupport.UnsupportedForTargetRuntimeIdentifier;
}
if (!hostRuntimeIdentifier.Equals(targetRuntimeIdentifier))

// If we have a separate pack pattern for the runtime pack,
// we should always use the runtime pack (the host pack may not have the tooling we need for the target).
bool useRuntimePackForAllTargets = false;
string targetPackNamePattern = packNamePattern;
if (knownPack.GetMetadata("ILCompilerRuntimePackNamePattern") is string runtimePackNamePattern)
{
targetPackNamePattern = runtimePackNamePattern;
useRuntimePackForAllTargets = true;
}

if (useRuntimePackForAllTargets || !hostRuntimeIdentifier.Equals(targetRuntimeIdentifier))
{
var targetIlcPackName = packNamePattern.Replace("**RID**", targetRuntimeIdentifier);
var targetIlcPackName = targetPackNamePattern.Replace("**RID**", targetRuntimeIdentifier);
var targetIlcPack = new TaskItem(targetIlcPackName);
targetIlcPack.SetMetadata(MetadataKeys.NuGetPackageId, targetIlcPackName);
targetIlcPack.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion);
Expand Down
Loading