I need to display the .NET Compact Framework version number on the screen. I am using .NET CF 2.0 with Windows CE 4.0.
So far, I have been ignoring the version numb
To display the product version with .NET Compact Framework ( tested with with 2.0 and 3.5 ), you can use AssemblyHelper.getProductVersion() defined below.
For example, if the assembly version is defined like below in AssemblyInfo.cs file, the result of the method is "1.2.3".
Extract of AssemblyInfo.cs file :
[assembly: AssemblyVersion("1.2.3")]
Extract of AssemblyHelper.cs file :
using System;
using System.Reflection;
public static class AssemblyHelper
{
public static string getProductVersion()
{
Version assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
return String.Format("{0}.{1}.{2}", assemblyVersion.Major, assemblyVersion.Minor, assemblyVersion.Build);
}
}