User1724605321 posted
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) :
AssemblyName.GetAssemblyName(@"c:\path\to\file.dll").Version
Reference : Programmatically get the version number of a DLL
Best Regards,
Nan Yu