I am trying to build a solution file using C# code using WPF application. Please find the code snippet below:
var buildEngine = new Engine();
var project = new Project(buildEngine);
project.Load(<pathToCsProjFile>);
project.SetProperty("Configuration", "Debug");
var success = project.Build();
if (success)
{
MessageBox.Show("Build Succeeded");
}
else
{
MessageBox.Show("Build Failed");
}
When I run the code above, variable "success" holds the value of false. Is there any way to capture the project output and display it in a textblock or any WPF control. I need to see the build errors if any in the application.