title: How to programmatically determine the active solution build configuration using MSBuild libraries in Powershell
body: <p>I'm in the process of writing a Powershell script that retrieves custom metadata from all the exe/dll projects in a particular C# solution.  </p>
  
  <p>My efforts have centered around using the Microsoft.MSBuild assembly (Construction and Evaluation namespaces) to parse the solution file and iterate over the projects to retrieve the metadata. This all works well.</p>
  
  <p>The next desire is to only concentrate on those projects that are part of the solution Active Build/Platform configuration - those with the Build bit checked in Visual Studio Configuration manager.</p>
  
  <p>While I am able to collect the list of project build configuration properties, I am struggling to find the how the solution file stores the Active Solution Build and Active Platform configuration selected values.</p>
  
  <p>In addition, I have also reviewed the source code for the MSBuild library and it appears to use an expression match between the project and solution configurations using the string for example: .Debug - Build|Any CPU.ActiveCfg = Debug|Any CPU.</p>
  
  <p>Can anyone shed any light as to how I should determine the Active Build/Platform configuration for the solution or projects?  </p>