-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Microsoft.Extensions.Logging.Abstractions 8.0.2 unnecessarily depends on System.Diagnostics.DiagnosticSource #110401
Comments
I reviewed the rest of #107161 for similar bugs in other projects, but didn't find any. |
cc: @ericstj |
Agree with @KalleOlaviNiemitalo. It looks like this was introduced with this backport: 8072b23#diff-b0675ddd797a8ed03ce040c5f2573e0817fd2a7bfa2a940de38b3c21187b7a0dR43 In 9.0 this assembly does depend on DiagnosticSource - #103138 When backporting the package reduction I missed removing this one. We'll still need that dependency moving forward in 9.0 and later. @KalleOlaviNiemitalo did you have a scenario where you weren't previously using DiagnosticSource and this change brought it in? Did it increase the size of your app? Just trying to understand the customer impact here. |
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
@ericstj, I am using Microsoft.Extensions.Logging.Abstractions in an optional add-in for a host program that targets .NET Framework. Neither the host nor the add-in had any dependency on System.Diagnostics.DiagnosticSource before. This bug caused System.Diagnostics.DiagnosticSource.dll to be included in the build artifacts. (Microsoft.Extensions.Logging 8.0.0 rightfully depends on System.Diagnostics.DiagnosticSource, because of #37092; but the add-in uses only Microsoft.Extensions.Logging.Abstractions and not Microsoft.Extensions.Logging. The host uses neither.) Customer impact:
I would have had to do this work eventually, when Microsoft ends support for .NET 8 LTS and I upgrade the Microsoft.Extensions.* package references from 8.* to 10.* versions. But I would have preferred not having to do this as part of upgrading Microsoft.Extensions.Logging.Abstractions within the 8.* branch. This upgrade was required because of a transitive dependency of a third-party package. |
Description
Microsoft.Extensions.Logging.Abstractions 8.0.1 did not depend on System.Diagnostics.DiagnosticSource, but Microsoft.Extensions.Logging.Abstractions 8.0.2 does, even though the Microsoft.Extensions.Logging.Abstractions.dll files in the package do not reference the System.Diagnostics.DiagnosticSource assembly.
Reproduction Steps
Review the
dependencies
elements in the nuspec files within the nuget packages.Microsoft.Extensions.Logging.Abstractions 8.0.1:
Microsoft.Extensions.Logging.Abstractions 8.0.2:
Check for references to System.Diagnostics.DiagnosticSource in the Microsoft.Extensions.Logging.Abstractions assembly metadata.
Expected behavior
The Microsoft.Extensions.Logging.Abstractions NuGet package should not depend on the System.Diagnostics.DiagnosticSource NuGet package.
Actual behavior
The Microsoft.Extensions.Logging.Abstractions NuGet package depends on the System.Diagnostics.DiagnosticSource NuGet package on some target frameworks.
Regression?
Yes, this is a regression from Microsoft.Extensions.Logging.Abstractions 8.0.1.
Known Workarounds
No response
Configuration
No response
Other information
This seems a bad cherry-pick in #107161 (to
release/8.0-staging
). It added a conditional<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\src\System.Diagnostics.DiagnosticSource.csproj" />
tosrc/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
even though it did not change any C# code in that project.The original #106172 (to
main
) likewise added a conditional ProjectReference, but it also removed an unconditional ProjectReference from another part of the file. This unconditional ProjectReference to System.Diagnostics.DiagnosticSource had been added in #103138 (tomain
) for the log buffering feature that is not on therelease/8.0
branch.This bug makes application maintenance a bit more complex by increasing the number of packages whose license terms and support status need to be tracked.
The text was updated successfully, but these errors were encountered: