如何以编程方式向解决方案添加/删除现有项目? [英] How to programmatically add/remove exsting projects to a solution?
问题描述
一个类似(不重复)的问题发布在这里:如何以编程方式列出解决方案中的所有项目?
A similar (not duplicate) question was posted at here: How do I programmatically list all projects in a solution?
在我之前的问题中:如何安全地重命名 Common 项目中的类(由多个解决方案共享),思想建议创建一个单独的解决方案,包括所有引用我的 Common 项目的项目.
In my previous question: How to safely rename a class in Common project (shared by multiple solutions), Thought suggested to create a separate solution to include all projects that reference my Common project.
所以现在我需要在我的通用解决方案中添加/删除现有项目.我目前有大约 50 个项目引用了 Common 项目,所以如果我能以编程方式从解决方案中添加/删除项目就好了.
So now I need to add/remove existing projects to my Common solution. I currently have about 50 projects reference the Common project, so it would be nice if I could programmatically add/remove projects from a solution.
谢谢
推荐答案
我遇到了同样的问题...
I had the same problem...
Project.Remove() 抛出 UnImplemented 异常
Project.Remove() throws UnImplemented exception
答案是使用:
和
Solution::AddFromTemplate( string FileName, string Destination, string ProjectName, bool Exclusive)
这篇关于如何以编程方式向解决方案添加/删除现有项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!