How to programmatically add/remove exsting projects to a solution?

五迷三道 提交于 2019-12-23 19:15:04

问题


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


回答1:


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)



来源:https://stackoverflow.com/questions/5375212/how-to-programmatically-add-remove-exsting-projects-to-a-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!