If you are trying to check while the application is running, you can enter System.Reflection and do something like this:
Assembly assembly = Assembly.GetExecutingAssembly();
if (assembly.FullName != null)
{
string versionPart = assembly.FullName.Split(',')[1];
string version = versionPart.Split('=')[1];
}
source
share