tags:

views:

499

answers:

3

so i have been doing some refactoring and reorganization and i have moved a bunch of files around.

i want to update each file so it has the "correct" namespaces according to its new location.

with resharper, i can go into each file and it shows me that the namespaces is incorrect but that way i need to do it each file at a time.

is there anyway to update namespaces across every file in a folder or a project?

+1  A: 

I think that R# doesn't have this function. You can use CTRL-SHIFT-H to find&replace the string.

ema
can you do find /replace just in a folder?
ooo
yes, you can do find/replace in a folder: in the Find In Files dialog, click the button with an ellipse next to the 'Look In' field, then specify your target folder(s)
Stuart Dunkeld
+2  A: 

This isn't quite what you want to do ... but hopefully it's helpful.

Go to the class view, and rename the namespace using Ctrl+R,R. It will update that namespace in all the files/folders that it's used in. As long as your namespaces are consistant, it should acheive the same result as changing all the namespaces in a folder.

If your namespaces aren't consistant, and you're just tidying up then I'm afraid you've got a lot of clicking in front of you (or behind you as you've probably already done this).

Mark Worth
Thanks, took me a while to work out what you meant, but this helped me a lot.
Hainesy
thanks! saved me a lot of clicking too.
Sam Holder
+3  A: 

UPDATE: Anyone reading this question with R#5.0 and above should be aware that this is now a feature:

ReSharper -> Refactor -> Adjust Namespaces...

IainMH