In actual projects, we sometimes encounter the need to modify the namespace because of Project reconstruction. In addition to modifying one class, most of them will be renamed by batch replacement. I encountered this problem again yesterday. the method I found on the Internet says that we should resharper to rename it. so I installed this tool and tried it on vs2008 and found that it could indeed be done. However, I tried it later. Without it, the vs tool can also be used for batch renaming, but there are restrictions.
The following two methods can be used if your namespace is just a single word. b. the C format can only be modified in a segment. You can change the first method to. b. c, but cannot be changed back to. b. The second method can only modify the last section C.If you want to completely modify the namespace, we recommend that you use resharper to rename it.. The latest version of resharper is 6.0 on the official website http://www.jetbrains.com/resharper /. For more information, see http://www.cnblogs.com/tianyaxiang/archive/2011/07/05/2098261.html.
Method 1: open a class to be modified in the project, right-click to refactor-Rename
Method 2:
1. Open the project, select the class library you want to change, and then select the menuView-Class View
2. Check the Class View to see the namespace of the class under the project.
3. Select the namespace to be renamed and right-click to rename
4. enter a new namespace
5. Click Application
Select "yes" and rename again.
That is, the modification is complete, and the namespace of all classes is renamed, which is so simple.
It is more efficient than batch replacement and is not prone to errors. You can use it for your own learning and only make a record.