private void initializeDllPaths()
{
testProjectGuids = new List<string>();
dllPaths = new Dictionary<string, string>();
coveredProjectGuids = new Dictionary<string, IEnumerable<string>>();
foreach(string projectFile in ProjectFilePaths)
{
XDocument projectDoc = XDocument.Load(projectFile);
XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003";
IEnumerable<string> OutputDirs = from propertyGroup in projectDoc.Descendants(ns + "PropertyGroup")
where propertyGroup.Element(ns + "DebugSymbols") != null &&
propertyGroup.Element(ns + "DebugSymbols").Value == "true"
select propertyGroup.Element(ns + "OutputPath").Value;
string OutputDir = OutputDirs.FirstOrDefault();
string AssemblyName = projectDoc.Descendants(ns + "AssemblyName").FirstOrDefault().Value;
string ProjectGuid = projectDoc.Descendants(ns + "ProjectGuid").FirstOrDefault().Value;
string dllPath = Path.Combine(OutputDir, AssemblyName + ".dll");
string projectFolder = Path.GetDirectoryName(projectFile);
dllPaths.Add(ProjectGuid, Path.Combine(projectFolder, dllPath));
var ProjectTypeNode = projectDoc.Descendants(ns + "ProjectTypeGuids").FirstOrDefault();
string ProjectTypeGuid;
if(ProjectTypeNode != null)
{
ProjectTypeGuid = ProjectTypeNode.Value;
}
else
{
ProjectTypeGuid = string.Empty;
}
if(ProjectTypeGuid.Contains(testProjectGuid))
{
var CoveredProjects = from projectRef in projectDoc.Descendants(ns + "ProjectReference")
select projectRef.Element(ns + "Project").Value;
coveredProjectGuids.Add(ProjectGuid, CoveredProjects);
testProjectGuids.Add(ProjectGuid);
}
}
}