// Load the project file var project = new Project("MyProject.csproj"); // Get all of the Compile items var compileItems = project.GetItems("Compile"); foreach (var item in compileItems) { Console.WriteLine(item.EvaluatedInclude); }
// Load the project file var project = new Project("MyProject.csproj"); // Get all of the Content items var contentItems = project.GetItems("Content"); foreach (var item in contentItems) { Console.WriteLine(item.EvaluatedInclude); }
// Load the project file var project = new Project("MyProject.csproj"); // Get all of the EmbeddedResource items var embeddedResourceItems = project.GetItems("EmbeddedResource"); foreach (var item in embeddedResourceItems) { Console.WriteLine(item.EvaluatedInclude); }These examples use the Microsoft.Build.Framework.dll package library.