-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CS0757 & CS0102 Logger source generator error #10553
Comments
Reference: #10093 and #8128 and #4311 @ali50m Build pass by remove <Target Name="Fxxxxx" AfterTargets="RemoveDuplicateAnalyzers"
Condition="$(MSBuildProjectName.Contains('_wpftmp'))">
<ItemGroup>
<FrameworkReference Remove="Microsoft.AspNetCore.App" />
</ItemGroup>
</Target> Adding the Adding the <Target Name="Fxxxxx" AfterTargets="RemoveDuplicateAnalyzers">
<ItemGroup>
<Analyzer Remove="C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.1\analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll" />
</ItemGroup>
</Target> will cause the The logger generator generate twice by WPF and The WPF's file is generated in MarkupCompilePass1: ,and it be used in
|
@franchyd The main reason is WPF have to create the tmp project to help build the xaml. And I think it can fix by using SourceGenerator to build the xaml or convert the xaml to csharp code or VB code, just like the MAUI or UNO or Avalonia. |
Yeah but thats not even on the WPF roadmap. Whereas many SG's are broken now due to the tmp project not de-duplicating SGs #7624 (comment) |
I'd like to add the Property as the Identifi of the wpf_tmp project. So that the analyzer can be skip to do more other thing.
No. The wpftmp project can not get the right Ok, the
|
Description
I have a WPF project, and recently I introduced an ASP FrameworkReference to it, but it resulted in a logger source generator error.
So, I simplified the project as much as possible to reproduce this issue. The code is at WpfLogger.
Reproduction Steps
Expected behavior
Build successfully.
Actual behavior
Build fail.
Regression?
No response
Known Workarounds
Pick any of following can make the build pass.
Impact
It will stop me using logger source generator in my WPF project after introducing ASP FrameworkReference.
Configuration
No response
Other information
dotnet: 9.0.2
windows: 10.0.26100
visual studio: Community Version 17.13.2
The text was updated successfully, but these errors were encountered: