How to: Restore C# Refactoring Snippets

C# refactoring operations rely on code snippets found in the following directory:

Installation directory\Microsoft Visual Studio 10.0\VC#\Snippets\language ID\Refactoring

If this Refactoring directory, or any files in this directory are deleted or corrupted, then C# refactoring operations may not work in the IDE. The following procedures can help you restore C# refactoring code snippets.

To verify C# refactoring snippets are available through the Code Snippet Manager

  1. In the Tools menu, select Code Snippet Manager.

  2. In the Code Snippet Manager dialog box, select Visual C# from the Language drop-down list.

    A Refactoring folder should appear in the tree view folder list.

To restore refactoring see comment in Code Snippet Manager

  1. If the Refactoring folder does not appear in the tree view folder list of the Code Snippet Manager, then use this procedure to add refactoring snippets back into Code Snippet Manager.

  2. In the Tools menu, select Code Snippet Manager.

  3. In the Code Snippet Manager dialog box, select Visual C# from the Language drop-down list.

  4. Click Add. The Code Snippets Directory dialog box, which helps you locate and specify the directory to add back into the Code Snippet Manager, appears.

  5. Locate the Refactoring folder whose directory path is:

    Installation directory\Microsoft Visual Studio 10.0\VC#\Snippets\language ID\Refactoring

    The actual path is similar to the following for a default installation:

    C:\Program Files\Microsoft Visual Studio 10.0\VC#\Snippets\1033\Refactoring.

  6. Click Open in the Code Snippets Directory dialog box, and then click OK in the Code Snippets Manager.

To repair Refactoring code snippets directory

  1. If refactoring still does not work after restoring refactoring snippets in Code Snippet Manager, then use this procedure to repair refactoring.

  2. In the Code Snippet Manager dialog box, click Search Online.

  3. Type refactoring license in the search box, and then click Search.

    The search results should include a Web site that enables you to download the .vsi file that you can use to reinstall the Refactoring folder.

See Also

Reference

Visual C# Code Snippets

Code Snippets Manager

Concepts

Refactoring (C#)