const string projectFileLocation = @"C:\MySolution.sln"; StreamReader sr = File.OpenText(projectFileLocation); const string matchProjectNameRegex = "^Project\\(\"(?<PROJECTTYPEGUID>.*)\"\\)\\s*=\\s*\"(?<PROJECTNAME>.*)\"\\s*,\\s*\"(?<PROJECTRELATIVEPATH>.*)\"\\s*,\\s*\"(?<PROJECTGUID>.*)\"$"; List<string> listOfProjects = new List<string>(); string lineText; while ( (lineText = sr.ReadLine()) != null) { if (lineText.StartsWith("Project(")) { Match projectNameMatch = Regex.Match(lineText, matchProjectNameRegex); if (projectNameMatch.Success) { listOfProjects.Add(projectNameMatch.Groups["PROJECTRELATIVEPATH"].Value); } } } foreach (string project in listOfProjects) { ProcessProject(project); } sr.Close();Notice that the code is trying to find the lines that begin with the "Project(" string. Those lines describe a projet existing into the solution. After that a regular expression is employed to extract the path where the project file is located relative to the solution file.