Created
April 16, 2013 21:01
-
-
Save kad1r/5399620 to your computer and use it in GitHub Desktop.
Get all projects in the solution with C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<string> GetSolutionList() | |
{ | |
List<string> prj = new List<string>(); | |
// "VisualStudio.DTE.11.0" | |
// this represents your visual studio version | |
// 11.0 means vs2012 | |
// 10.0 means vs2010 | |
// 9.0 means vs2005 | |
for (int i = 1; i < ((EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.11.0")).Solution.Projects.Count + 1; i++) | |
{ | |
prj.Add(((EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.11.0")).Solution.Projects.Item(i).Name); | |
} | |
return prj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment