Change the name of your active document, and all related files, quickly and accurately using Rename Files. Visual Assist will update your project, solution, and files that refer to your renamed file. Additionally, a rename is propagated through source control systems that integrate with Visual Studio.
Access
Begin the rename by opening the context menu (Right-Click or Shift+F10) anywhere in the active document.
![](/~/media/wholetomato/kb/documentation/rename-files/renamefilescontextmenu.ashx?la=ru&hash=316D05ECA2753057A903DA7A680E36566B3F072B)
Select Rename Files, enter a new name, preview the files to be renamed or updated, and accept to complete the refactoring.
![](/~/media/wholetomato/kb/documentation/rename-files/renamefilesdroid.ashx?la=ru&hash=DCA1FE38FBBDF511743F2BE28DDA863067D7B84D)
Rename to Class
If the caret is on a class name, you can begin Rename Files with the Quick Action and Refactoring menu (Shift+Alt+Q). Your class name will be the default destination name. (Rename Files is often run this way after renaming a class.)
![](/~/media/wholetomato/kb/documentation/rename-files/renamefilesclass.ashx?la=ru&hash=8B2C9ACC3C03A91332B54192A443DD926E2CF7E1)
![](/~/media/wholetomato/kb/documentation/rename-files/renamefilesclassdialog.ashx?la=ru&hash=9C2B2F9FF75B6A9815F92C980C9A18BB63F4649D)
Related Files
In C/C++, if you rename a header file, the corresponding source file will be renamed. And vice versa, rename of a source file changes the header file. Additionally, files that #include a renamed header file are modified to refer to the newly named header file.
In C#, design and code-behind files are renamed simultaneously. For example, rename of Myform.cs also renames MyForm.Designer.cs and MyForm.resx.
Destination
Renamed files remain in their existing directories. You cannot use Rename Files to move a file to a new directory.
Save and Undo
Files are saved before they are renamed.
Files are not saved after Rename Files, including files modified only to #include a newly named header file. Use the Save All command of the IDE to save after Rename Files.
You cannot undo Rename Files in a single step. (The exception is via separate command of a source code control system.) If you wish to revert a change, use Rename Files a second time to change names to their original, or yet another name.
Non-Project Files
You can rename files that are part of a disk-based project, open when no solution is open, or exclusive of an open solution. In these instances, Visual Assist will confirm your intent.
![](/~/media/wholetomato/kb/documentation/rename-files/renamefilesoutsideproject.ashx?la=ru&hash=151E297260856CE830E80CF8F22A46C6229BDE6D)
If your file is indeed part of a project or solution, you should rename when the project or solution is open so Visual Assist can update the project/solution files, as well as other files that might depend on your renamed files.
Universal Windows Application
Rename Files works across shared projects of a Universal Windows Application (UWA).
![](/~/media/wholetomato/kb/documentation/rename-files/renamefilesuniversal.ashx?la=ru&hash=9514ABD01EABC8B62644CD73C4A047073435DADE)
Visual Studio 2003 and older
Rename Files is not available.