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.
Once you click the rename which will have a dialog box open which will ask for new name or variable like following.
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. :)
This feature is currently in Visual Studio 2008 as well.
ReplyDeleteIn 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.
ReplyDeleteBut 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.
Very cool, thanks for the post
ReplyDelete