如何在Visual Studio 2013中的源代码管理下复制和重命名解决方案 [英] How to copy and rename a solution under source control in Visual Studio 2013

查看:320
本文介绍了如何在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:

  1. 将整个解决方案文件夹复制到新位置.
  2. 删除所有源代码控制文件.它们以* .vs开头.
  3. 删除文件夹和文件上的所有只读属性.
  4. 从新文件夹中打开解决方案,并重命名解决方案和每个项目.
  5. 打开每个项目的属性,然后编辑程序集名称和默认名称空间.
  6. 关闭解决方案.
  7. 重命名磁盘上的文件夹.
  8. 在文本编辑器中编辑解决方案文件.将所有引用替换为新的文件夹名称,然后删除.sln中的团队基础"部分.
  9. 再次在VS中打开解决方案,并修复所有剩余的问题.我使用Resharper修复新的名称空间.
  10. 在所有文件中搜索您的旧解决方案/文件夹名称,并使用新名称更新
  11. 考虑删除obj和bin文件夹,以强制Visual Studio在生成过程中重新生成所有这些文件.
  12. 再次将解决方案添加到源代码管理中.
  1. Copy entire solution folder to new location.
  2. Remove any source control files. They begin with *.vs.
  3. Remove any read-only attributes on folders and files.
  4. Open solution from new folder and rename solution and each project.
  5. Open properties for each project and edit assembly name and default namespace.
  6. Close solution.
  7. Rename folders on disk.
  8. Edit solution file in a texteditor. Replace all references with new folder names, and remove team foundation section in .sln.
  9. Open solution again in VS and fix any leftover issues. I use Resharper to fix new namespaces.
  10. Search through all files for your old solution/folder name and update with new name
  11. Consider deleting the obj and bin folders to force Visual Studio to regenerate all of those files during a build
  12. Add solution to source control again.

您完成了.

这篇关于如何在Visual Studio 2013中的源代码管理下复制和重命名解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆