I know that I can do this to get the app\'s official (release/publish) version number:
string version = Assembly.GetExecutingAssembly().GetName().Version.ToS
The value returned from Assembly.GetExecutingAssembly().GetName().Version
is that in your project's AssemblyInfo.cs file:
[assembly: AssemblyVersion("1.0.0.0")]
Modify these before a build to specify the value it returns. Or, as documented in the same AssemblyInfo.cs file:
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]