Reputation: 151
Is there any FxCop or StyleCop rule that warns when there is a using
statement that is no longer referenced by any object in the file?
Upvotes: 5
Views: 2960
Reputation: 2979
In addition to Udo's answer and this answer, I also needed to uncheck Suppress results from generated code (managed only) which can be found under Properties > Code Analyses.
So all in all:
Upvotes: 2
Reputation: 459
You can enable the rule IDE0005 C# Using directive is unnecessary.
in the category Style
.
Upvotes: 5