Add explicit PackageReferences for transitive Microsoft.Extensions.* …#5211
Open
DrewScoggins wants to merge 3 commits intodotnet:mainfrom
Open
Add explicit PackageReferences for transitive Microsoft.Extensions.* …#5211DrewScoggins wants to merge 3 commits intodotnet:mainfrom
DrewScoggins wants to merge 3 commits intodotnet:mainfrom
Conversation
…abstractions For .NET 10+, NuGet package pruning removes transitive Microsoft.Extensions.* abstractions (Logging.Abstractions, DependencyInjection.Abstractions, Options, Primitives) from project.assets.json because they are in-band in Microsoft.AspNetCore.App. Without them, the build fails with CS0246 for types like ILogger, IChangeToken, ObjectFactory, StringSegment, etc. Disabling pruning via RestoreEnablePackagePruning=false (PR #5209) only preserves DIRECT PackageReferences. Transitive prunable deps are still removed. Add them as explicit PackageReferences so they remain app-local for BenchmarkDotNet's corerun toolchain (which targets a Microsoft.NETCore.App CoreRoot that does not include the AspNetCore.App shared framework). Also re-enable Microsoft.Extensions.Primitives for net10+ (PR #5196 wrongly removed it assuming it was in NETCore.App; it is actually in AspNetCore.App). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LoopedBard3
previously approved these changes
Apr 27, 2026
Same root cause: NuGet pruning removes this transitive dep on net10+, causing CS0246 for IConfiguration in ConfigurationBinderBenchmarks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LoopedBard3
previously approved these changes
Apr 27, 2026
Same root cause: NuGet pruning removes this transitive dep on net10+, causing CS0012/CS0246 for ICacheEntry and IMemoryCache. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+113
to
+115
| (Logging.Abstractions, DependencyInjection.Abstractions, Options) from the resolution graph | ||
| because they are in-band in Microsoft.AspNetCore.App. We need them as direct PackageReferences | ||
| so they remain app-local for BenchmarkDotNet's corerun toolchain (which targets a |
There was a problem hiding this comment.
The comment lists only Logging.Abstractions/DependencyInjection.Abstractions/Options, but this ItemGroup also adds Caching.Abstractions and Configuration.Abstractions. Update the comment to reflect the full set of explicit abstractions being added (or clarify why those two are included).
Suggested change
| (Logging.Abstractions, DependencyInjection.Abstractions, Options) from the resolution graph | |
| because they are in-band in Microsoft.AspNetCore.App. We need them as direct PackageReferences | |
| so they remain app-local for BenchmarkDotNet's corerun toolchain (which targets a | |
| (Caching.Abstractions, Configuration.Abstractions, Logging.Abstractions, | |
| DependencyInjection.Abstractions, Options) from the resolution graph because they are | |
| in-band in Microsoft.AspNetCore.App. We need them as direct PackageReferences so they | |
| remain app-local for BenchmarkDotNet's corerun toolchain (which targets a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…abstractions
For .NET 10+, NuGet package pruning removes transitive Microsoft.Extensions.* abstractions (Logging.Abstractions, DependencyInjection.Abstractions, Options, Primitives) from project.assets.json because they are in-band in Microsoft.AspNetCore.App. Without them, the build fails with CS0246 for types like ILogger, IChangeToken, ObjectFactory, StringSegment, etc.
Disabling pruning via RestoreEnablePackagePruning=false (PR #5209) only preserves DIRECT PackageReferences. Transitive prunable deps are still removed. Add them as explicit PackageReferences so they remain app-local for BenchmarkDotNet's corerun toolchain (which targets a Microsoft.NETCore.App CoreRoot that does not include the AspNetCore.App shared framework).
Also re-enable Microsoft.Extensions.Primitives for net10+ (PR #5196 wrongly removed it assuming it was in NETCore.App; it is actually in AspNetCore.App).