ReSharper 2017.1 Help

Code Inspection: Class is never instantiated (non-private accessibility)

This is a solution-wide code inspection. It only works when the solution-wide analysis is enabled.

ReSharper determines if no objects of a class were created in a project — in fact, if no direct instances or usages of the class were found. If the class only contains static members (and/or constant fields), ReSharper suggests making the class static. In other cases ReSharper suggests making the class abstract, if possible.

Note that due to the fact that ReSharper only detects direct instantiation or usage, it will issue this warning even in cases when the class is, in fact, being used, but is instantiated indirectly — for example, via reflection or a dependency injection container.

See Also

Last modified: 4 July 2017