Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -173,6 +173,13 @@

<!-- Include Microsoft.AspNetCore.App for Package Pruning -->
<_AspNetCoreAppPackageOverrides Include="$(SharedFrameworkName)|$(ReferencePackSharedFxVersion)" />

<!--
Exclude Microsoft.Extensions.FileProviders.Embedded from pruning because it contains build logic
required to generate the embedded files manifest. The package's build targets are not in the SDK,
so they must be available from the package itself. See https://github.com/dotnet/aspnetcore/issues/63719
-->
<_AspNetCoreAppPackageOverrides Remove="Microsoft.Extensions.FileProviders.Embedded|$(ReferencePackSharedFxVersion)" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this exclude it from both conflict resolution & pruning?

Should we have a more targeted fix, one that targets pruning only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding (and I could easily be wrong) was that PlatformManifest.txt would still allow the conflict resolution logic to work: https://github.com/dotnet/sdk/blob/50f42240f56f2a15c1102100911a0d7f4ca4b6ff/src/Tasks/Common/ConflictResolution/ResolvePackageFileConflicts.cs#L131

</ItemGroup>

<WriteLinesToFile
Expand Down
18 changes: 17 additions & 1 deletion src/Framework/test/TargetingPackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,25 @@ public void PackageOverridesContainsCorrectEntries()
.Split(';', StringSplitOptions.RemoveEmptyEntries)
.ToHashSet();

// PackageOverrides will contain all Aspnetcore/Runtime ref pack libs, plus an entry for Microsoft.AspNetCore.App
// Some packages are excluded from pruning because they contain build logic that is not in the SDK.
// These packages need their build targets to execute even though their runtime assemblies are in the shared framework.
string[] packagesExcludedFromPruning = ["Microsoft.Extensions.FileProviders.Embedded"]; // See https://github.com/dotnet/aspnetcore/issues/63719

foreach (var excludedPackage in packagesExcludedFromPruning)
{
aspnetcoreDependencies.Remove(excludedPackage);
}

// PackageOverrides will contain all Aspnetcore/Runtime ref pack libs, plus an entry for Microsoft.AspNetCore.App,
// minus any packages excluded from pruning
Assert.Equal(packageOverrideFileLines.Length, runtimeDependencies.Count + aspnetcoreDependencies.Count + 1);

// Verify that excluded packages are NOT in PackageOverrides
foreach (var excludedPackage in packagesExcludedFromPruning)
{
Assert.DoesNotContain(packageOverrideFileLines, line => line.StartsWith(excludedPackage + "|", StringComparison.Ordinal));
}

// PackageOverrides versions should remain at Major.Minor.0 while servicing.
var netCoreAppPackageVersion = TestData.GetMicrosoftNETCoreAppVersion();
Assert.True(
Expand Down
Loading