I know that I can do this to get the app's official (release/publish) version number:
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
this.Text = String.Format("Platypi R Us - version {0}", version);
...but this only shows a "Publish version" of my app* ("1.0.0.0"). I want to show the build number.
Barring that, or in addition to that, I'd like to show the date and time of the last build, so that it says "Platypi R Us - version 3.14 (7/17/2012 16:22)"
The build number is reported in Settings > About phone. For Android Oreo, it is shown in Settings > System > About phone.
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.*")]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With