so there are two versions of .NET programs, not just one (which I know of). Assembly version is what you capture and it is easier to retrieve in .NET. This is essentially a ".NET version", so when assemblies have different versions, this is the one it uses.
that is, "File Version" or in one place, I see that Microsoft even called it "Build File Version" to make the confusion even worse. so you really need to find out if the name includes "file" or not. this version of the โFileโ for the assembly is related to the file system, so when you look at the version in Windows Explorer, this is what you get.
why Microsoft divided them into two different things and did not bind them together, I do not understand. maybe someone can enlighten me further.
I just figured out the code to capture FileVersion. I found this question because I was looking for how to get it (in VB, not C #). I think C # simplifies most of the things, including access to the Assembly. So, here is the VB code to extract the version of your program file:
Dim fileName$ = System.Reflection.Assembly.GetExecutingAssembly().Location Dim fileName2$ = Application.ExecutablePath ' this grabs the filename too, ' but
wow, a lot of code for something that should be something simple, like it was in VB6. Maybe even App.Version.ToString or something like that. Wow. way, Microsoft! at least itโs not as difficult as some of their tricks, for example, just playing your own musical string.
source share