0
我想弄清楚在相應的構建配置/平臺設置中啓用/禁用哪個項目。我在哪裏可以找到這個「project.BuildsInCurrentConfiguration」信息?Roslyn - 確定從構建配置中排除的項目
var properties = new Dictionary<string, string>
{
{ "Configuration", "Debug" },
{ "Platform", "x86"}
};
MSBuildWorkspace workspace = MSBuildWorkspace.Create(properties);
workspace.LoadMetadataForReferencedProjects = true;
Solution solution = workspace.OpenSolutionAsync("someSolution.sln").Result;
foreach (Project project in solution.Projects)
Console.Out.WriteLine($"{project.OutputFilePath} is enabled in this build setup: {project.BuildsInCurrentConfiguration}");
workspace.CloseSolution();
我本來以爲我不會提供不屬於拿起配置/平臺的一部分的項目,但solution.Projects顯示我所有的人,無論構建設置。