Project ConfigureProject(string file, string configuration, string platform)
{
var p = engine.GetLoadedProjects(file).FirstOrDefault();
if (p == null)
{
var content = buildEngine.GetUnsavedProjectContent(file);
if (content == null)
{
p = engine.LoadProject(file);
}
else
{
p = engine.LoadProject(new XmlTextReader(new StringReader(content)));
p.FullPath = file;
}
}
p.SetProperty("Configuration", configuration);
if (!string.IsNullOrEmpty(platform))
{
p.SetProperty("Platform", platform);
}
else
{
p.SetProperty("Platform", "");
}
return(p);
}