如何在Visual Studio 2013中的源代码管理下复制和重命名解决方案 [英] How to copy and rename a solution under source control in Visual Studio 2013
本文介绍了如何在Visual Studio 2013中的源代码管理下复制和重命名解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为ShoppingService.sln的VS2013解决方案,在TFS源代码管理下有7个项目. 现在,我想复制该解决方案,将其重命名为"BasketService.sln",然后再次将其置于源代码控制之下. 我不想成为原始解决方案的分支,因为这两个解决方案应该相互独立存在.
I have a VS2013 solution called ShoppingService.sln with 7 projects under TFS source control. Now I want to make a copy of the solution, rename it to 'BasketService.sln' and have it under source control again. I don't want to make branches of the original solution, since both solutions should co-exist separate from each other.
最快或最好的方法是什么?
What's the quickest or best way to do this?
推荐答案
好,这就是我最终要做的事情:
Ok, here's what I ended up doing:
- 将整个解决方案文件夹复制到新位置.
- 删除所有源代码控制文件.它们以* .vs开头.
- 删除文件夹和文件上的所有只读属性.
- 从新文件夹中打开解决方案,并重命名解决方案和每个项目.
- 打开每个项目的属性,然后编辑程序集名称和默认名称空间.
- 关闭解决方案.
- 重命名磁盘上的文件夹.
- 在文本编辑器中编辑解决方案文件.将所有引用替换为新的文件夹名称,然后删除.sln中的团队基础"部分.
- 再次在VS中打开解决方案,并修复所有剩余的问题.我使用Resharper修复新的名称空间.
- 在所有文件中搜索您的旧解决方案/文件夹名称,并使用新名称更新
- 考虑删除obj和bin文件夹,以强制Visual Studio在生成过程中重新生成所有这些文件.
- 再次将解决方案添加到源代码管理中.
- Copy entire solution folder to new location.
- Remove any source control files. They begin with *.vs.
- Remove any read-only attributes on folders and files.
- Open solution from new folder and rename solution and each project.
- Open properties for each project and edit assembly name and default namespace.
- Close solution.
- Rename folders on disk.
- Edit solution file in a texteditor. Replace all references with new folder names, and remove team foundation section in .sln.
- Open solution again in VS and fix any leftover issues. I use Resharper to fix new namespaces.
- Search through all files for your old solution/folder name and update with new name
- Consider deleting the obj and bin folders to force Visual Studio to regenerate all of those files during a build
- Add solution to source control again.
您完成了.
这篇关于如何在Visual Studio 2013中的源代码管理下复制和重命名解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文