|
How to disable SourceGenerator from CommunityToolkit.Mvvm? |
Answered by
Hakoyu
Sep 12, 2026
Replies: 2 comments 1 reply
|
Don't use any of the attributes that trigger it and it will not do anything 🙂 |
1 reply
|
Oh find, can disable analyzer content from CommunityToolkit.Mvvm. <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="DisableMvvmToolkitSourceGenerators" BeforeTargets="CoreCompile">
<ItemGroup>
<_MvvmToolkitAnalyzers
Include="@(Analyzer)"
Condition="$([System.String]::Copy('%(Analyzer.Filename)').Contains('CommunityToolkit.Mvvm.SourceGenerators'))"
/>
<Analyzer Remove="@(_MvvmToolkitAnalyzers)" />
</ItemGroup>
</Target> |
0 replies
Answer selected by
Hakoyu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh find, can disable analyzer content from CommunityToolkit.Mvvm.
In this way, you can use attributes such as ObservableProperty and RelayCommand without triggering analyzer.