If you are going to delete a type, type member, or any other symbol in C# or VB.NET code files, ASP.NET code and markup, build scripts, or XAML, use the Safe Delete refactoring to ensure that the delete operation is safe. If there are no symbol usages found, the symbol will be deleted right away. Otherwise, ReSharper will show all the usages, allowing you to edit the corresponding code. Usages that can be safely deleted are marked with the icon. Removing usages marked with the icon, will lead to compilation errors.
- Position the caret at the name of a symbol that you want to delete.
- Choose ReSharper | Refactor | Safe Delete, or press Alt+Delete. The Safe Delete dialog box opens:
- Click Next. If no usages of the symbol are found, the symbol is deleted immediately. If ReSharper finds usages, it shows the Conflicts page:
- Click links to view symbol usages and modify them.
- Click Next to delete the symbol.