-
Notifications
You must be signed in to change notification settings - Fork 860
Fix CS0757 error when multi-targeting with Microsoft.Extensions.Telemetry.Abstractions #7062
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
b8badfc
66c5eb2
1a3aa11
dec1fad
25054c3
a00b32e
99a4472
d864ca3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| <Project> | ||
| <!-- This package should replace the "Microsoft.Extensions.Logging.Abstractions" source generator. --> | ||
| <Target Name="_Microsoft_Extensions_Logging_AbstractionsRemoveAnalyzers" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fact that the two targets had the same name was very intentional, as we want to make sure that the targets are replaced such that only one ever runs in a project evaluation. Do we have a repro project where we can clearly see the issue? I'd like to see that to better understand the problem and validate the RCA made here, as I don't think that target naming colissions was the problem. |
||
| <Target Name="_Microsoft_Extensions_Telemetry_AbstractionsRemoveAnalyzers" | ||
| Condition="'$(DisableMicrosoftExtensionsLoggingSourceGenerator)' == 'true'" | ||
| AfterTargets="ResolveReferences"> | ||
| <ItemGroup> | ||
|
|
@@ -19,7 +19,7 @@ | |
| <!-- We have a WPF-specific target because WPF projects generate and compile a temporary project (via "GenerateTemporaryTargetAssembly" target), | ||
| and that temp project doesn't have "ResolveReferences" target we expect. | ||
| This leads to the runtime's generator not being removed and to a compile-time error CS0757. This additional target resolves the problem. --> | ||
| <Target Name="_Microsoft_Extensions_Logging_AbstractionsRemoveAnalyzersWPF" | ||
| <Target Name="_Microsoft_Extensions_Telemetry_AbstractionsRemoveAnalyzersWPF" | ||
| Condition="'$(DisableMicrosoftExtensionsLoggingSourceGenerator)' == 'true'" | ||
| AfterTargets="RemoveDuplicateAnalyzers"> | ||
| <ItemGroup> | ||
|
|
||
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.