title: Access Version from AssemblyInfo in MSBuild
body: <p>I am trying to create/push nuget package through visual studio build process as explained <a href="http://ihadthisideaonce.wordpress.com/2012/02/21/creating-packages-with-nuget-the-msbuild-way/" rel="noreferrer">here</a>.</p>
  
  <p>Building package is easy:</p>
  
  <pre><code>&lt;Exec WorkingDirectory="$(ProjectDir)" Command="$(NuGetApp) pack $(ProjectFile) -OutputDirectory $(Deploy) -Verbose -Prop Configuration=Release"/&gt;
  </code></pre>
  
  <p>I see .nupkg file in $(Deploy) folder.</p>
  
  <p>But to be able to push it, I need $(AssemblyVersion) to use it in :</p>
  
  <pre><code>&lt;Exec Command="$(NuGetApp) push $(ProjectName)$(AssemblyVersion) -s $(NugetServer) $(NugetKey)" /&gt;
  </code></pre>
  
  <p>I tried XMLRead to fetch the value, but value in NugetSpecFile is "$version$" instead of version from AssemblyInfo.cs.</p>
  
  <pre><code>&lt;XmlRead XPath="/package/metadata/version" XmlFileName="$(NuSpecFile)"&gt;
        &lt;Output TaskParameter="Value" PropertyName="AssemblyVersion" /&gt;
      &lt;/XmlRead&gt;
  </code></pre>
  
  <p>How do I access version so I could use it in "nuget push"?</p>