Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Hi @bic ,
Thank you for reporting this. I was able to reproduce this behavior locally. It appears to be a known limitation of the analyzer's current design rather than a bug.
The IDE0130 analyzer skips checking partial classes if they are spread across multiple files. This is because the automatic "fixer" tool (which runs when you try to automatically fix the warning in your editor) does not currently support fixing partial classes with multiple parts.
Because the tool cannot safely fix the warning for a partial class spread across a normal .cs file and a generated .g.cs file, it chooses to skip checking the rule completely to avoid showing a warning that it cannot automatically solve.
There is an open issue on the dotnet/roslyn repository tracking this exact limitation. A Microsoft team member confirmed this is currently the intended behavior, but they are open to fixing it based on community feedback.
You can view the issue here: IDE0130 does not report on partial classes (#72749).
I suggest upvoting that issue and leaving a brief comment about your experience with generated files. This helps the team understand how this limitation affects developers and may help prioritize a fix.
If this answers your question, I would greatly appreciate it if you could follow this guidance or provide feedback.
Thank you.