title: Specify publish version with MSBuild command line as assembly version of project
body: <p>I have a simple batch file that I'm running from a DOS command line that is used for building a small C# application that publishes a <a href="http://en.wikipedia.org/wiki/ClickOnce" rel="noreferrer">ClickOnce</a> project. One line is this:</p>
  
  <pre><code>msbuild MyApp.csproj /t:publish /property:PublishDir="deploy/"
  </code></pre>
  
  <p>This currently publishes the application, but it uses the <em>Publish Version</em> that I set up in Visual Studio's "Publish" tab. I'm hoping to be able to set the publish version at the command line, and specifically, I'd like to use the <em>Assembly Version</em> of the project. Something like:</p>
  
  <pre><code>msbuild MyApp.csproj /t:publish /property:PublishDir="deploy/" /property:PublishVersion="$(Proj.AssemblyVersion)"
  </code></pre>
  
  <p>I'm hoping to do without creating a custom task, since this is just an interim solution, and I will replace it with a more proper build system later.</p>
  
  <p>Alternatively, I've looked at updating the published manifest version using the <a href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx" rel="noreferrer">Mage Command Line Tool</a> with the <code>-Update</code> flag, but I did not know how to retrieve the assembly version number from the project or built assembly without using <a href="http://en.wikipedia.org/wiki/Windows_PowerShell" rel="noreferrer">PowerShell</a> or some program that would need to be downloaded. If I could use something that comes with Visual Studio, that would work as well.</p>