with extension vassisx, you can bind keys to this: vassisx.refactorintroducevariable

and i think this does what you want.


to get 'extract constant' you need to install 'powercommands for visual studio 2010' from:


for msvs 2013 you can download productivity power tools 2013 to get extract constant - features also ctrl + click to peek definition (customizable to go to definition as in all other ides i used) and it is free !

to install go to tools > extensions and updates... then online


there's no native visual studio 2010 refactoring command for 'extract local', as eclipse has.

the closest you'd get is the 'extract constant', which isn't by default bound to a keyboard shortcut. to do this, you have to highlight the entire string, including the double-quote " delimiters.

extract constant

you could explore third party ide addons like coderush or resharper for more functionality.

Related Query

More Query from same tag