-
Notifications
You must be signed in to change notification settings - Fork 5k
[Release/8.0-staging] Reduce net core app current package dependencies #107161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Release/8.0-staging] Reduce net core app current package dependencies #107161
Conversation
…et#106172) * Avoid package dependencies on libraries in the shared framework We can avoid these dependencies since we can count on the library being part of the shared framework. Fewer dependencies means less packages downloaded, less for customers to service, less copied into the output directory when serviced. * Add warning code. * Address feedback
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
This is a backport of the fix for #105120 |
b71a69b
to
93d0af7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after your explanation in our call.
/ba-g The unknown failure seems unrelated to this PR. I opened #107413 to track it. |
@ericstj do you want to do the honors and smash the squash and merge button? |
Customer Impact
Customers using packages like
Microsoft.Extensions.Logging.Console
,System.Memory.Data
,Microsoft.Extensions.Hosting
, etc and targetingnet8.0
need to update package references for packages likeSystem.Text.Json
,System.Text.Encodings.Web
,System.Collections.Immutable
, etc even though those libraries are provided by the shared framework.We can reduce the number of places where folks need to update packages by omitting packages when the same library is provided by the framework. In particular this will fix Aspire templates so that they'll not need to add packages in servicing to avoid vulnerability warnings from NuGet audit.
Regression
Testing
Build packages. Add validation to make sure all up-stack packages ship as well. Tested these updates with Aspire template to confirm that NuGet audit warnings go away - 2 framework packages were dropped (JSON and STEW).
Risk
Low. This is removing package references for a few packages and enabling more packages. The biggest risk here is that we'll be enabling a lot of packages that need to flow in servicing.
Background
This drops package dependencies from all packages which can reference the framework copy of the same library (without downgrading the library exposed to a compatible TFM like netstandard2.0).
I also added a feature to our build that enforces transitive servicing. You can specify
ServiceTransitiveDependencies
to make sure that you enable all up-stack packages for shipping when enabling a single package.I enabled all packages I changed, then all upstack packages (separate commits).
This should improve the situation where folks are asked to update just to update a package reference on the latest framework.
It will also help reduce application size since the libraries will no longer be bundled in the app.