Anyone knows why am I having different file versions of a executable file in windows properties and visual Studio?
I'm querying the same file... for sure! What am I mising....
This is my code:
private string getFileVersion(string filePath)
{
try
{
return FileVersionInfo.GetVersionInfo(filePath).FileVersion;
}
catch (FileNotFoundException ex)
{
mLogFile.addLogEntry("XML file. " + ex.Message);
return null;
}
}
UPDATE:The File I'm querying it is not the project executable file.
thanks
The developer of that application didn't update the "FileVersion" string to match the information in the other properties.
Build the file version information from the following information:
FileVersionInfo info = FileVersionInfo.GetVersionInfo(filePath);
String version = String.Format("{0}.{1}.{2}.{3}", info.FileMajorPart
, info.FileMinorPart
, info.FileBuildPart
, info.FilePrivatePart);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.