合并 Visual Studio 解决方案文件
我们有两个大型解决方案文件,希望将其合并为一个解决方案。
我们可以将解决方案 A 中的项目添加到解决方案 B 中。但想知道是否有更省时的方法来执行此操作?
We have two large solution files that we would like to merge into a single solution.
We could just add the projects from solution A to solution B. But wondering if there is a less time consuming way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我刚刚使用 Perl 和一些 regex magic
该脚本应该适用于 Windows 和 Linux,尽管我在 Linux 上开发并运行了它。
I just solved this myself using Perl and some regex magic
The script should work for both Windows and Linux, though I developed and ran it on Linux.
合并同一解决方案文件的两个版本非常容易出错 - 在我看来,合并两个单独的文件会更容易出错。
我不知道有什么工具可以做到这一点 - 我的常规方法是使用 VS 本身并手动添加项目。
It's quite error-prone merging two versions of the same solution file - merging two separate files would be even more error-prone in my opinion.
I know no tools for this - my normal approach has been to use VS itself and manually add the projects.
您可以尝试使用此工具:
http://code.google.com/p/merge -solutions/
它还可以检测并修复项目/解决方案项中的重复行会,这是项目范围复制粘贴的常见结果。
You can try playing around with this tool:
http://code.google.com/p/merge-solutions/
It can also detect and fix duplicate guilds in projects/solution items that is a common result of project-wide copypaste.
几天前我必须自己做
下载源码+bin (54KiB)
(没有许可证/公共领域/copyleft/任何让你感觉良好的东西:)
I had to make my own a few days ago
download source+bin (54KiB)
(no license/public domain/copyleft/whatever makes you feel good:)
我有类似的要求,将几个 .sln 文件合并为一个(Visual Studio 2013)。我所做的是:
在 Visual Studio 中打开一个 .sln [文件 >打开>项目/解决方案...]
在 Visual Studio 中打开第二个 .sln [文件 >打开>项目/解决方案...] 但选择“添加到解决方案”选项。然后,您可能会收到同名项目已存在的警告 - 忽略它们。如果存在重复的文件夹名称,您可能需要在将项目添加到新的 .sln 文件后解决它们
对所有其余 .sln 文件重复步骤 2
这对我有用,但不确定如果出现重复的 GUID 会发生什么。
I had similar requirement to merge a few .sln files into one (Visual Studio 2013). What I did was:
Open one .sln in visual studio [File > Open > Project/Solution...]
Open second .sln in visual studio [File > Open > Project/Solution...] but select 'Add to Solution' option. You might then get warnings that project of same name already exists - ignore them. If there are duplicate folder names, you may need to resolve them after the projects are added to new .sln file
Repeat step 2 for all the rest of .sln files
This worked for me, not sure what would happen in case of duplicate GUIDs though.