Change namespace automatically when changing folder file

Asked

Viewed 763 times

4

I need to restructure the folders of a project, only that there are many files and their respective namespaces need to be changed.

Is there any way to change the namespace automatically when moving a file. Cs from one folder to another?

  • If you use R# you can change the folder files and at the end use the option to adjust the namespaces (select the files, right-click on the files, Refactor -> Adjust namespaces (shortcut: Ctrl+R, Ctrl+R)).

  • You can install Resharper?

  • Omni and Gypsy, I use the VS2013 Express. I tried to install it but could not because of the version.

  • @Filipeoliveira could try to install the Coderush (I’m not sure it works on Express).

  • @Omni, Coderush also does not work on no Express.

  • @Filipeoliveira the response of Sunstreaker is able to help you. Just pay attention to the comment I made in this reply (prevents headaches and speeds up the process)

Show 1 more comment

1 answer

2


A way to do this in Visual Studio without external aid is to make a simple locate and replace, press the keys CTRL + Shift + H, will open the window shown below, now just replace the namespace.

inserir a descrição da imagem aqui

  • 2

    effectively, the lack of external assistance is the best that can be done. Although it is better to change the Look in for a more restricted scope (for example open all files in the folder and do the Find and Replace in the open files.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.