0

In eclipse, when we refactor/rename the folder name, the namespace will got rename automatically. So we don't need to go to each single file to rename the namespace.

junnyea
  • 471
  • 6
  • 8
  • Possible duplicate of https://stackoverflow.com/questions/4809197/whats-the-best-way-to-do-a-bulk-namespace-rename-on-a-large-c-sharp-application – Gil Grossman Sep 06 '17 at 06:36
  • hi Gil, it is not a duplication, I am asking if there is any way the refactoring can be like the way eclipse does. – junnyea Sep 06 '17 at 07:06
  • do you work with resharper? – Gil Grossman Sep 06 '17 at 07:22
  • yes. if u happen to work in eclipse, when u rename any folder in eclipse, it will auto rename all the namespaces. resharper tools is cool but it dont have such function afaik. – junnyea Sep 06 '17 at 07:26

1 Answers1

0

When using resharper you may adjust the namespaced automatically based on the folder names (resharper documentation).
The easiest flow would be:
1. Right click the folder name and click rename (change the folder name)
2. Right click the folder name -> hoover over "refactor" -> click "Adjust namespaces..." (image: folder menu right click)
3. "Adjust Namespaces" windows appear and you may choose files where you want to fix namespaces
(image: Adjust Namespaces resharper window)

Gil Grossman
  • 139
  • 2
  • 8