I like to place the version number of the current application either on the console output or the title bar of the Winform. Using the below method I am able to extract the current assemblies information and return the version info to be displayed.

using System.Reflection;
using System.Diagnostics;

~
// Place in local code
Assembly ass = Assembly.GetExecutingAssembly();
string version;

if (ass != null)
{
    FileVersionInfo FVI = FileVersionInfo.GetVersionInfo(ass.Location);

    version = String.Format("{0} Version ({1:0}.{2:0})",
                  FVI.ProductName,
                  FVI.FileMajorPart.ToString(),
                  FVI.FileMinorPart.ToString());
}
else
{
   version = "Unknown";
}
Share