title: How to use an 'Output' parameter from a target in MSBuild
body: <p>I'm trying to understand some MSBuild concept (I'm familiar with <a href="http://en.wikipedia.org/wiki/NAnt" rel="nofollow noreferrer">NAnt</a>).</p>
  
  <p>I try to initialise some property in a target and then used it in another. Here is  an example:</p>
  
  <pre><code>&lt;propertygroup&gt;
      &lt;MyProp&gt;X&lt;/MyProp&gt;
  &lt;/propertygroup&gt;
  
  &lt;target name="Main"&gt;
      &lt;message text="$(MyProp)"/&gt; &lt;!-- Display 'X' --&gt;
      &lt;CallTarget Target="Sub"&gt;
          &lt;Output TaskParameter="localProp" PropertyName="MyProp"/&gt;
      &lt;/CallTarget&gt;
      &lt;message text="$(MyProp)"/&gt; &lt;!-- should display 'Y' --&gt;
  &lt;/target&gt;
  
  &lt;target name="Sub" Outputs=$(localProp)&gt;
      &lt;propertygroup&gt;
          &lt;localProp&gt;Y&lt;/localProp&gt;
      &lt;/propertygroup&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>And it of course does not work.</p>