title: How to synchronise the publish version to the assembly version in a .NET ClickOnce application?
body: <p>In my C# ClickOnce application, there is an auto-incremented publish version in the Project -> <em>Properties</em> -> <em>Publish</em> tab. I'd like to display that version in my menu <em>Help</em> -> <em>About</em> box, but the code I'm using apparently accesses the assembly Version, which is different.</p>
  
  <p>The Assembly Version can be changed manually in the Project -> <em>Properties</em> -> <em>Application</em> -> Assembly Information dialog. So for now, every time before I publish I've been copying the publish version to the assembly version, so my dialog shows the current version of 
  the application. There must be a better way to do this.</p>
  
  <p>All I really want to do is have an accurate, auto-updated, code-accessible version number.</p>
  
  <p>Here's the code I'm using to access the assembly version number:</p>
  
  <pre><code>public string AssemblyVersion
  {
      get
      {
          return Assembly.GetExecutingAssembly().GetName().Version.ToString();
      }
  }
  </code></pre>
  
  <p>An alternative would be to find code that accesses the publish version.</p>