Apr 15, 2019 02:59 AM|Nan Yu|LINK
Hi gunderj ,
There are two possible 'versions' , one is windows filesystem file version, applicable to all executable files . To get that in c# :
// Get the file version for the notepad.
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(@"C:\MyAssembly.dll");
// Print the file name and version number.
Console.WriteLine("File: " + myFileVersionInfo.FileDescription + '\n' +
"Version number: " + myFileVersionInfo.FileVersion);
One is assembly build version, which is embedded in a .NET assembly by the compiler (obviously only applicable to .NET assembly dll and exe files) :
Reference : Programmatically get the version number of a DLL