ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code Inspection: Non-accessed field (Private accessibility)

Last modified: 08 March 2021

C# compiler can issue a number of warnings regarding unused fields:

Although ReSharper knows about all these warnings and provides design-time notifications for them, it goes one step further and detects unused fields not covered by compiler warnings. The example below shows that even if a field is assigned non-constant value and has no read usages, ReSharper will help you detect the unused member.