title: How can I get the current Active Solution Platform name for use in a Visual Studio add-in? (C#)
body: <p>I am creating a Visual studio add-in writing in C# allowing users to send their code to a remote PC for parsing. The process will differ depending on what Active Solution Platform is being used.</p>
  
  <p>I would like the add-in to be able to obtain the current Active Solution Platform so the users code can be processed correctly.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>try    
  {
  SolutionBuild builder = applicationObject.Solution.SolutionBuild;
  SolutionConfiguration2 config;
  config = (SolutionConfiguration2)builder.SolutionConfigurations.Item(1);
  MessageBox.Show("The platform name of 
  the solution configuration is: " + config.PlatformName);
  }
  catch(SystemException ex)
  {
     MessageBox.Show(ex.ToString());
  } 
  </code></pre>
  
  <p>However this always returns the first Platform in the list, not the current platform.</p>