简体   繁体   English

更改完整的项目名称空间,程序集,文件夹和引用

[英]Change complete project namespace, assemblies, folders and references

I have a big solution with about 250 projects. 我有大约250个项目,是一个很大的解决方案。 I need to change the prefix of solution (my company name) from "X" to "Y". 我需要将解决方案的前缀(我的公司名称)从“ X”更改为“ Y”。 Of course some of the projects' names start with the prefix - X.Utilties, X.Dal... Means I should change project namespaces, assemblies, folders and references and even injection (IoC). 当然,某些项目的名称以前缀-X.Utilties,X.Dal ...开头。这意味着我应该更改项目的名称空间,程序集,文件夹和引用,甚至是注入(IoC)。 What is the best and safest easy way to do it? 最好,最安全的简便方法是什么?

I´d suggest getting the trial version of Resharper and using the available refactoring tools to change all namespaces. 我建议获得Resharper的试用版,并使用可用的重构工具来更改所有名称空间。

From the top of my head you´d do it this way: 从我的头顶上,您可以这样做:

  1. Manually edit your project files to have the new name (or do it with find/replace) 手动编辑项目文件以使用新名称(或使用查找/替换名称)

  2. Reopen the solution in visual studio 在Visual Studio中重新打开解决方案

  3. Right click on the solution > Refactor > Adjust namespaces 右键单击解决方案>重构>调整名称空间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM