title: Running MSBUILD through code and getting asynchronous progress
body: <p>I am wanting to run MSBUILD through code, and get asynchronous status of the build as it progresses (similar to TeamCity or any other build runner does).</p>
  
  <p>I am using the following code:</p>
  
  <pre><code>var projectFileName = @"...\MyApplication\MyApplication.sln";
  ProjectCollection pc = new ProjectCollection();
  var GlobalProperty = new Dictionary&lt;string, string&gt;();
  GlobalProperty.Add("Configuration", "Debug");
  GlobalProperty.Add("Platform", "x86");
  
  var buildRequest = new BuildRequestData(projectFileName, GlobalProperty, null, new string[] { "Build" }, null);
  
  var buildResult = BuildManager.DefaultBuildManager.Build(new BuildParameters(pc), buildRequest);
  </code></pre>
  
  <p>Is there a way to get the current executing MSBUILD task through code?</p>