如何以编程方式向解决方案添加/删除现有项目?
此处发布了类似(不重复)的问题:如何以编程方式列出解决方案中的所有项目?
在我之前的问题中:如何安全地重命名公共项目中的类(由多个解决方案共享),想法建议创建一个单独的解决方案以包含引用我的 Common 项目的所有项目。
所以现在我需要在我的通用解决方案中添加/删除现有项目。我目前有大约 50 个项目引用 Common 项目,因此如果我能够以编程方式从解决方案中添加/删除项目,那就太好了。
谢谢
A similar (not duplicate) question was posted at here: How do I programmatically list all projects in a solution?
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.
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.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题...
Project.Remove() 抛出 UnImplemented 异常
答案是使用:
Solution::Remove(Project prj);
和
Solution::AddFromTemplate( string FileName, string Destination, string ProjectName, bool Exclusive)
I had the same problem...
Project.Remove() throws UnImplemented exception
the answer is to use:
Solution::Remove(Project prj);
and
Solution::AddFromTemplate( string FileName, string Destination, string ProjectName, bool Exclusive)