Share via


Rename Dialog Box

Use Rename to rename identifiers in your code for symbols such as fields, local variables, methods, namespaces, properties, and types.

  • New Name
    Specifies the new name for an identifier, which is the code element that you intend to rename.

  • Location
    Identifies the namespace to search when it performs the rename operation.

  • Preview Reference Changes
    If checked, the Preview Changes Dialog Box appears before your code is modified.

  • Search in comments
    Specifies to search in comments when the check box is selected.

  • Search in strings
    Specifies to search in strings when the check box is selected.

  • Rename overloads
    Specifies to include method overloads in the refactoring operation. If checked, the refactoring engine only renames methods of the same name within the type - not in base or inherited types.

    Note

    This option is only available for methods.

Remarks

When comments and strings are searched by the Rename refactoring operation, the text is changed based on simple string matching in a global search and replace operation. It is recommended that you select Preview Reference Changes when Search in comments or Search in strings is selected.

When renaming a namespace, Visual Studio also updates the Default Namespace property on the Application Page of the Project Designer. This property cannot be reset by selecting Undo from the Edit menu. To reset the Default Namespace property value, you must modify the property in the Project Designer.

See Also

Tasks

How to: Rename Identifiers

Reference

Rename

Preview Changes Dialog Box