The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.