All docs
V19.2
19.2
19.1
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

CRR0043 - Unused type

This analyzer detects types that are never referenced.

internal class UnusedClass
{
}

public class UsedClass
{
    private class AnotherUnusedClass
    {

    }
}

To fix issues, remove the unused classes:

public class UsedClass
{

}

Call the Remove Unused Type refactoring to remove an unused type. To do it in different places at once, use the Code Cleanup feature with Remove unused types and Remove unused private types rules enabled.

Note

The Remove Unused Type refactoring and Code Cleanup with Remove unused types rule cannot be applied to public types.