Created
April 11, 2013 23:30
-
-
Save kad1r/5368066 to your computer and use it in GitHub Desktop.
This code gives you the list of projects which are in the open solution in visual studio.
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
string slnPath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).Parent.Parent.Parent.FullName; | |
List<string> projects = new List<string>(); | |
foreach (string f in Directory.GetFiles(slnPath)) | |
{ | |
if (f.Contains(".sln")) | |
{ | |
string[] arr = System.IO.File.ReadAllLines(f); | |
for (int i = 0; i < arr.Length; i++) | |
{ | |
if (arr[i].StartsWith("Project")) | |
{ | |
string[] temp = arr[i].Split(','); | |
projects.Add(temp[1]); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment