title: MSBuild Conditional Imports
body: <p>Is there a workaround for conditional imports in MSBuild?</p>
  
  <p>I've found evidence <a href="http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/a48b5b57-215c-44f9-b750-106efe3ea023" rel="nofollow noreferrer">here</a> and <a href="http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/d5acb498-6d87-4063-86e8-245dcb7d9dcb" rel="nofollow noreferrer">here</a> detailing a bug in the MSBuild IDE interface.  In particular, <code>Import</code> statements do not reload when building:</p>
  
  <blockquote>
    <p>This is a known limitation.  VS will only ever process the  tags once, when the project is loaded.  So whatever  tag is active at the time the project is first loaded (based on whatever values your properties have at that time)... that's the  tag that you will get for the lifetime of that project in the IDE</p>
  </blockquote>
  
  <p>For example, I might want to import the <code>bar</code> or <code>baz</code> project based on the value of <code>foo</code>:</p>
  
  <pre><code>&lt;Import Project="bar.targets" Condition="'$(foo)' == 'bar'" /&gt;
  &lt;Import Project="baz.targets" Condition="'$(foo)' == 'baz'" /&gt;
  </code></pre>
  
  <p>Is there a workaround or different approach I can use for accomplishing the desired functionality?</p>