Is there a way to get visual studio to warn that a private member does not have any references within the class? How about internal members that have no references within the package / module?
I ha开发者_运维技巧ve been re-factoring my code and I don't want to keep [right-click] --> Find All References for each member in my code base to ensure I have removed all cruft. There has to be a better way...
Have you tried turning on FxCop performance rules? They will detect unused members with internal or private access.
As far as I know, Visual Studio does give warnings for unused variables. Doesn't that cover it? They are not errors, just warnings.
NDepend is perfect for this sort of thing.
ReSharper does something similar with its Solution-Wide Inspections.
精彩评论