-
Notifications
You must be signed in to change notification settings - Fork 751
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
Replace platform's Logging source generator #4238
Conversation
@ViktorHofer this currently doesn't work when targeting netcoreapp3.1, because currently the logging.abstractions package has a different buildTransitive .targets file for that TFM which just shows the not supported warning instead of having the mechanism that the rest of the TFMs have for disabling the source generator: You would need a workaround similar than the one I'm introducing here which allows for extra content on that generated file in order for this to work. |
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.
Terrific!
This is by design as packages produced by dotnet/runtime don't support netcoreapp3.1. The runtime has been out-of-support since December 2022. We communicate this via the Warning task that we emit. cc @ericstj |
Yes, it does. 🙂 |
cc: @geeknoid @RussKie @ViktorHofer @tarekgh
This PR will make sure that when Microsoft.Extensions.Telemetry.Abstractions package gets referenced, the import of the Microsoft.Extensions.Logging.Abstractions package is disabled as the new referenced package's source generator should take precedence.
For additional context, the package Microsoft.Extensions.Logging.Abstractions has a built-in targets file which will check if the property
DisableMicrosoftExtensionsLoggingSourceGenerator
is set to true, and if so, it will disable the automatic reference of the logging generator included in that package. The changes in this PR are just setting that value when the extensions Telemetry package gets referenced, in order to replace the logging generator with the extensions version.Microsoft Reviewers: Open in CodeFlow