ReSharper 2026.1 Help

Code inspection: Entity is only used to capture its name (private accessibility)

This inspection reports a parameter or local variable when it is only used to capture its own name via nameof(...), but its value is never used. That usually means the declaration itself is unnecessary.

Example

void LogParameter(string value) { Console.WriteLine(nameof(value)); }

Quick-fix

There is no dedicated quick-fix for this inspection. A typical improvement is to remove the unused declaration and replace nameof(value) with the intended literal or redesign the API so the actual value is used.

13 April 2026