title: Overwrite properties with MSBuild
body: <p>I want to declare three properties in my MSBuild file and overwrite one property with the value of another (depending on the target being called), but can't figure out how to do this.  My build file looks something like this:</p>
  
  <pre><code>&lt;PropertyGroup&gt;
     &lt;DeployPath_TEST&gt;\\test-server-path\websites\mysite&lt;/DeployPath_TEST&gt;
     &lt;DeployPath_LIVE&gt;\\live-server-path\websites\mysite&lt;/DeployPath_LIVE&gt;
     &lt;DeployPath&gt;&lt;/DeployPath&gt;
  &lt;/PropertyGroup&gt;
  
  &lt;Target Name="Deploy-TEST"&gt;
     &lt;PropertyGroup&gt;
        &lt;DeployPath&gt;$(DeployPath_TEST)&lt;/DeployPath&gt;
     &lt;/PropertyGroup&gt;
     &lt;CallTarget Targets="Deploy-Sub"/&gt;
  &lt;/Target&gt;
  
  &lt;Target Name="Deploy-LIVE"&gt;
     &lt;PropertyGroup&gt;
        &lt;DeployPath&gt;$(DeployPath_TEST)&lt;/DeployPath&gt;
     &lt;/PropertyGroup&gt;
     &lt;CallTarget Targets="Deploy-Sub"/&gt;
  &lt;/Target&gt;
  
  &lt;Target Name="Deploy-Sub"&gt;
     &lt;Message Text="Deploying to $(DeployPath)"/&gt;
     &lt;MSBuild Projects="MySolution.csproj" Targets="Rebuild" /&gt;
  
     &lt;ItemGroup&gt;
       &lt;MyFiles Include="**\*"/&gt;
     &lt;/ItemGroup&gt;
  
     &lt;Copy SourceFiles="@(MyFiles)" 
           DestinationFiles="@(MyFiles-&gt;'$(DeploymentPath)\%(RecursiveDir)%(FileName)%(Extension)')"/&gt;
  
  &lt;/Target&gt;
  </code></pre>
  
  <p>At the moment I'm trying to re-declare the property setting it's value accordingly, but this isn't working.</p>