Automatic Symbol Renaming When You Rename a File in Solution Explorer

Tips Search

If you like the tips then you'll love the book!

Order your copy today:
http://www.amazon.com/gp/product/0735649928

Automatic Symbol Renaming When You Rename a File in Solution Explorer

  • Comments 5

Menu:  Tools -> Options -> Projects And Solutions -> General
Versions:  2008,2010
Published:  2/19/2010
Code:  vstipTool0011

 

When you rename, say, a Class File from "Class1" to "bubba" for example:

image

 

You receive this prompt:

image

 

Which, in this simple case, results in the renaming of the class and the file:

image

 

 

If you find yourself doing this a lot then you can get rid of the prompt to rename by going to Tools -> Options -> Projects And Solutions -> General then remove the check from the "Prompt for symbolic renaming when renaming files" option:

image

 

From now on when you do your renaming the prompt will not appear and your symbols will be renamed automatically.

  • This feature always annoyed me because it didn't do a full refactoring; e.g., XML documentation comments were not updated.

    But it seems that from a quick test this has been fixed in VS 2010 RC.  Thanks, now I probably will enable the feature to not even prompt :)

  • In VS2008, I sometimes don't get this prompt when rename a file, so I prefer getting this prompt and make sure the IDE is doing refactor. Maybe I'll take a look at VS2010 and see if this is fixed as Dave said.

  • dan,

    by default you should always get a prompt in vs2008,2010 so there might be something else going on if the dialog is intermittent.

    Z

  • While this feature is a nice start, I miss the (IMHO much more important) feature to prompt for a new filename when creating a copy of a file in the same directory.

  • This is a great feature to prompt for a <a href="http://www.ulfwood.net/RenameFiles/FileRenamer.aspx">Rename Files</a>. And it is easy to use it.

Page 1 of 1 (5 items)
Leave a Comment
  • Please add 6 and 8 and type the answer here:
  • Post