Resharper - how to import all missing namespaces?

I replaced using the Find-Replace extension method because Resharper was unfortunately unable to replace it correctly. I now have 4000 errors in my solution, and they all have to do with no namespace for the new method, so I desperately need the functionality to "fix / import all missing namespaces in the solution".

Does Resharper or some other tool have such things, or am I going to spend the next hours browsing the files by pressing ALT + ENTER?

+3


source to share


1 answer


Been there, did it.

It may not be the most elegant way, but it worked for me and took 10 minutes on a massive project. I used the global replace tool and added using MyApp.Domain.Required.Namespace

to the beginning of all files. We then used R # on all files to clean up the namespaces: select the project in Solution Explorer, press Ctrl + Shift + R and choose Configure Namespaces.



But do checkin / shelf / stash regardless of your revision control so you can rollback. It took me a few tries before I got R # to clean up the namespaces correctly.

+6


source







All Articles