Skip to content

Commit c6af9e9

Browse files
committed
Fix PrepareForReadyToRunCompilation task after runtime pack rename
Use FrameworkName metadata to find the runtime pack for Microsoft.NETCore.App, instead of a now-outdated convention.
1 parent 5e742e2 commit c6af9e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ protected override void ExecuteCore()
6969
string supportedRuntimeIdentifiers = frameworkRef == null ? null : frameworkRef.GetMetadata("RuntimePackRuntimeIdentifiers");
7070

7171
// Get information on the runtime package used for the current target
72-
ITaskItem frameworkPack = RuntimePacks.Where(pack => pack.ItemSpec.EndsWith(".Microsoft.NETCore.App", StringComparison.InvariantCultureIgnoreCase)).SingleOrDefault();
72+
ITaskItem frameworkPack = RuntimePacks.Where(pack =>
73+
pack.GetMetadata(MetadataKeys.FrameworkName).Equals("Microsoft.NETCore.App", StringComparison.OrdinalIgnoreCase))
74+
.SingleOrDefault();
7375
_runtimeIdentifier = frameworkPack == null ? null : frameworkPack.GetMetadata(MetadataKeys.RuntimeIdentifier);
7476
_packagePath = frameworkPack == null ? null : frameworkPack.GetMetadata(MetadataKeys.PackageDirectory);
7577

0 commit comments

Comments
 (0)