title: How to have an auto incrementing version number (Visual Studio)?
body: <p>I want to store a set of integers that get auto incremented at build time:</p>
  
  <pre><code>int MajorVersion = 0;
  int MinorVersion = 1;
  int Revision = 92;
  </code></pre>
  
  <p>When I compile, it would auto-increment <code>Revision</code>. When I build the setup project, it would increment <code>MinorVersion</code> (I'm OK with doing this manually). <code>MajorVersion</code> would only be incremented manually.</p>
  
  <p>Then I could display a version number in menu Help/About to the user as:</p>
  
  <pre>
    Version: 0.1.92
  </pre>
  
  <p>How can this be achieved?</p>
  
  <p>This question asks not only how to have an auto-incrementing version number, but also how to use that in code which is a more complete answer than others.</p>