title: get real product version in c#
body: <p>This may seem fairly straight forward, however, the typical methods to get the version only grab the version info which needs to be manually set, and not the build versions from publish.</p>
  
  <p>This results in (if I never go into the properties and change the value deep inside project settings), the version always returning 1.0.0.0.  In fact, this is also the version that always shows up when I right click any compiled .NET exe from inside any of the publish folders. For example :</p>
  
  <p><code>/publish/1.0.0.2/foo.exe</code></p>
  
  <p>The properties show <code>1.0.0.0</code>, even though that is build <code>1.0.0.2</code>.</p>
  
  <p>I am willing to accept a solution that will do either of the following :</p>
  
  <ol>
  <li>Automatically set the actual file version to the current version on publish.</li>
  <li>Obtain the actual version (not 1.0.0.0) using c#.</li>
  </ol>
  
  <p>Not looking for a hack to add my own versioning system. I would like to use the mechanisms that are built in (and were working PERFECTLY in predecessors to .NET).</p>
  
  <p>For added clarification, it seems the auto-versioning is garbage in .NET, and instead of using the Publish version, it is using the versions from inside</p>
  
  <p>Properties > Application > [Assembly Information]
  <img src="https://i.stack.imgur.com/pOfsI.png" alt="enter image description here"></p>
  
  <p>Thanks in advance :)</p>