I can build a project with the following
static bool Build()
{
var projectCollection = ProjectCollection.GlobalProjectCollection;
var project = projectCollection.LoadProject(websiteProject);
var fileLogger = new FileLogger();
fileLogger.Parameters = @"logfile=" + @"app_data\log.txt";
projectCollection.RegisterLogger(fileLogger);
bool result = project.Build();
projectCollection.UnregisterAllLoggers();
return result;
}
But I need to be able to set the build configuration to Release. I've had a look through the documentation, but either I'm missing it or there's not an easy way to set it.