WPF 源生成器报错的解决方案
解决方案
在项目文件中添加
1 <!-- https://github.com/dotnet/wpf/pull/6680#issuecomment-1183552170 --> 2 <Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile"> 3 <RemoveDuplicates Inputs="@(Analyzer)"> 4 <Output TaskParameter="Filtered" ItemName="FilteredAnalyzer"/> 5 </RemoveDuplicates> 6 <ItemGroup> 7 <Analyzer Remove="@(Analyzer)" /> 8 <Analyzer Include="@(FilteredAnalyzer)" /> 9 </ItemGroup> 10 </Target>