Back to Devexpress

Remove Unused Type

coderushforroslyn-400843-refactoring-assistance-remove-unused-type.md

latest807 B
Original Source

Remove Unused Type

  • Aug 19, 2021

Purpose

Removes types that are never executed or referenced.

You can use this refactoring to ensure the type you want to delete is not referenced in your code.

Note

This refactoring cannot be applied to public types.

Availability

Available when the cursor is in a type declaration. This type is never used in code.

How to Use

  1. Place the caret in an unused type declaration.

  2. Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.

  3. Select Remove Unused Type from the menu.

After execution, the Refactoring removes the unused type.

csharp
public class UsedClass
{

}
vb
Public Class UsedClass
End Class