title: Retrieving the nupkg version number in msbuild
body: <p>I've modified a <em>csproj</em> file in VS2017 to create a Nuget package when my .NET 4.5 project is release-built. The next automation step is to add this package to my private feed on a network share.  Here are the commands I'm using:</p>
  
  <pre><code>&lt;Exec Command="nuget.exe pack -Properties &amp;quot;Configuration=Release&amp;quot; -Symbols $(ProjectName).csproj" /&gt;
  &lt;Exec Command="nuget.exe add $(ProjectName).$(ProductVersion).nupkg -source \\MYSERVER\Nuget packages" /&gt;
  </code></pre>
  
  <p>Line 1 works and produces a nupkg file of the form <em>productname.nn.nn.nn.nn</em>.</p>
  
  <p>However line 2 is not returning a value for the <em>ProductVersion</em> token (which was a guess on my part).</p>
  
  <p>I've struggled to find a reference for MSBUILD tokens (that in itself would be useful to know), but what I really need to know is the correct MSBUILD token/variable/property for the the version - and that is the same value as the generated Nuget package.</p>