Rename feature in Visual Web Developer 2010/Visual Studio 2010

Visual web developer is great tool and I am playing more and more with it and every time I am discovering some new features of it. Recently I have discovered a very cool feature of it. I want to rename a variable in visual studio 2010 Web Developer express edition and I found a great refractor tool for that which will rename that variable in all the instance and all the methods. First you need to select variable which you want to rename and then you need to Right Click ->Refractor->Rename. You can also invoke that via its shortcut Ctrl + R,Ctrl +R and it will be available For reference see the below screenshot.

Rename variable featuers in visual studio 2010

Once you click the rename which will have a dialog box open which will ask for new name or variable like following.

RenameDilaog option in visual web developer 2010

It is also having options for search in comments and search in string. Search in comment will search and replace in comment and search in string will replace word for any string which contains that variable name. Once you put new name in dialog box it will display a preview of replaced strings like following. Here also you can select where you need to rename and where you don’t want to rename and this is really cool. :)

Preview dialog for visual web developer 2010

Shout it

This entry was posted in .NET4.0 , C#-4.0 , VisualStudio . Bookmark the permalink.

3 Responses to Rename feature in Visual Web Developer 2010/Visual Studio 2010

  1. Anonymous says:

    This feature is currently in Visual Studio 2008 as well.

  2. Anonymous says:

    In Visual Studio 2008 I could do Rename in a .cs file and the variable was renamed also in the .aspx file, which is perfect, exactly what I want.

    But now in Visual Studio 2010, when I Rename a variable in the .cs, it doesn't take into consideration the file .aspx where that variable also is used. And therefore the Renaming is not complete. This is really awful.

Leave a Reply

Your feedback are very important to me. Please provide your feedback via putting comments.



P.S. If you really like this post, make sure you subscribe to our RSS feed receive new post in reader or via email. You can also follow us at Twitter or like us at Facebook.


Disclaimer:

The opinions expressed here is my personal view and that is not related to my employers . I am trying to provide good quality content in this blog but still there is no guarantee for code of examples and other things.