Skip to content

Commit 785cd9a

Browse files
authored
Fix runtime targeting pack (#11582)
1 parent dab27e7 commit 785cd9a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

eng/tools/RepoTasks/CreateFrameworkListFile.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public class CreateFrameworkListFile : Task
2323
[Required]
2424
public string TargetFile { get; set; }
2525

26+
public string ManagedRoot { get; set; } = "";
27+
28+
public string NativeRoot { get; set; } = "";
29+
2630
/// <summary>
2731
/// Extra attributes to place on the root node.
2832
///
@@ -46,7 +50,6 @@ public override bool Execute()
4650
{
4751
Item = item,
4852
Filename = Path.GetFileName(item.ItemSpec),
49-
TargetPath = item.GetMetadata("TargetPath"),
5053
AssemblyName = FileUtilities.GetAssemblyName(item.ItemSpec),
5154
FileVersion = FileUtilities.GetFileVersion(item.ItemSpec),
5255
IsNative = item.GetMetadata("IsNativeImage") == "true",
@@ -55,15 +58,14 @@ public override bool Execute()
5558
.Where(f =>
5659
!f.IsSymbolFile &&
5760
(f.Filename.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || f.IsNative))
58-
.OrderBy(f => f.TargetPath, StringComparer.Ordinal)
59-
.ThenBy(f => f.Filename, StringComparer.Ordinal))
61+
.OrderBy(f => f.Filename, StringComparer.Ordinal))
6062
{
6163
var element = new XElement(
6264
"File",
6365
new XAttribute("Type", f.IsNative ? "Native" : "Managed"),
6466
new XAttribute(
6567
"Path",
66-
Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/')));
68+
Path.Combine(f.IsNative ? NativeRoot : ManagedRoot, f.Filename).Replace('\\', '/')));
6769

6870
if (f.AssemblyName != null)
6971
{

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
2525

2626
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
2727
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
28+
<!-- We still need the native path to these assets though for the RuntimeList.xml manifest -->
29+
<ManagedAssetsPackagePath>$(BuildOutputTargetFolder)$(DefaultNetCoreTargetFramework)</ManagedAssetsPackagePath>
2830
<!-- Target framework is not append to this because native assets to not have a target framework. -->
2931
<NativeAssetsPackagePath>runtimes/$(RuntimeIdentifier)/native/</NativeAssetsPackagePath>
3032

@@ -457,6 +459,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
457459
<RepoTasks.CreateFrameworkListFile
458460
Files="@(SharedFxContent)"
459461
TargetFile="$(FrameworkListOutputPath)"
462+
ManagedRoot="$(ManagedAssetsPackagePath)"
463+
NativeRoot="$(NativeAssetsPackagePath)"
460464
RootAttributes="@(FrameworkListRootAttributes)" />
461465

462466
<ItemGroup>

0 commit comments

Comments
 (0)