怎么样:
const string xmlNamespace = "{http://schemas.microsoft.com/developer/msbuild/2003}"; return from projectPath in projectPaths let xml = XDocument.Load(projectPath) let dir = Path.GetDirectoryName(projectPath) from c in xml.Descendants(xmlNamespace + "Compile") where c.Attribute("Include").Value.EndsWith(".cs") select Path.Combine(dir, c.Attribute("Include").Value);