How do I take a Visual Studio Solution (.sln) as input and get a list of all the projects it contains?
+1
A:
It's just a text file. Open it up in a text editor and see. You're looking for all the Project directives. Writing a simple parser to just extract the *.vcproj names shouldn't be difficult at all.
Warren Young
2009-10-07 08:45:09
+2
A:
This array will give you full solution details with project created with in solution..
public List<string> getAllProjectNames(string path)
{
string[] arr = System.IO.File.ReadAllLines(path);
List<string> projects = new List<string>();
for (int i = 0; i < arr.Length; i++)
{
if (arr[i].StartsWith("Project"))
{
string [] temp = arr[i].Split(',');
projects.Add(temp[1]);
}
}
return projects;
}
Call this metohd like..
List<string> Arr = getAllProjectNames(@"D:\Projects\PersonalRD\SearchingList\SearchingList.sln");
after that try to search all project names where the string item starts with project..
Jaswant Agarwal
2009-10-07 08:57:43