1

I'm currently writing a little cmd line app that will take an entire visual studio solution, copy it to a new folder and change the namespaces of all the projects.

Looks like its going to take some regex magic to get this working properly (and quite a bit of effort).

Am I reinventing the wheel? - is there anything in visual studio or anywhere else that will do this for me?

Thanks in advance!

4

3 回答 3

0

I use Search and Replace when I need to change namespace of an entire solution, and to move to another directory... I just delete the project and open it again from source control in a different directory (if you don't use a SCM tool, just copy the root of the project and whatever beneath it to the new location)

all paths should be relative to the root.

于 2009-11-09T16:57:13.553 回答
0

Refactor->rename doesn't work? It won't move it to a new directory but will find all references and change them.

于 2009-11-09T17:00:10.560 回答
0

不幸的是,这不是一个简单的搜索替换,即使使用 Visual Studio 提供的简单重构,这也会变得棘手。例如,您可以通过选择要重命名的命名空间来开始重构。但是,如果您有任何资源字符串或程序集设置,您可能会感到惊讶,即使应用程序编译,它也可能在运行时找不到资源。有时,只需在文本编辑器(不是在 Visual Studio 上)中打开该资源或设置文件,然后更正罪魁祸首字符串。但是,尝试手动(或通过定制的脚本)完成此操作可能会更糟。

于 2011-05-24T04:15:26.997 回答