File Version and Assembly Version
What is the difference between File Version and Assembly version in c# with suitable simple exambles ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Mar 16, 2011, 1:55 PM
VulpesPosted Mar 14, 2011, 6:38 AM
Here's a quick example (compile this to version.exe):
using System;
using System.Diagnostics;
using System.Reflection;
class Version
{
static void Main()
{
string fileVersion = FileVersionInfo.GetVersionInfo("version.exe").FileVersion;
Console.WriteLine(fileVersion);
string assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
Console.WriteLine(assemblyVersion);
string fileVersion2 = FileVersionInfo.GetVersionInfo(@"c:\windows\system32\notepad.exe").FileVersion;
Console.WriteLine(fileVersion2);
Console.ReadKey();
}
}
On my Windows 7 machine, the output is:
0.0.0.0
0.0.0.0
6.1.7600.16385 (win7_rtm.090713-1255)
ShankeyPosted Mar 14, 2011, 6:13 AM