How do I programmatically list all projects in a solution?

前端 未结 12 1459
感动是毒
感动是毒 2020-11-29 04:06

How do I programmatically list all of the projects in a solution? I\'ll take a script, command-line, or API calls.

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 04:29

    You can use the EnvDTE.Solution.Projects object to programmatically get access to the projects in a solution.

    One gotcha though is that if you have any SolutionFolders in your solution, any projects in these folders are not shown in the above collection.

    I've written an article including a code sample on how to get all projects regardless of any solutionfolders

提交回复
热议问题