1
votes

We know that an assembly has three version numbers associated with it, which are AssemblyFileVersion, AssemblyInformationalVersion, and AssemblyVersion

I get the idea of AssemblyInformationalVersion abd I understand the fact that when CLR loads an asssembly, it only care AssemblyVersion, and according to the answer of this post https://stackoverflow.com/a/802038/9623401:

The AssemblyFileVersion is intended to uniquely identify a build of the individual assembly

but both of them have Major.Minor.Build.Revision format, isn't that AssemblyFileVersion and AssemblyVersion the same thing?

Let's say I build an assembly from scratch, after a couple of days, the work seems to fnish, so I change AssemblyVersion to be 1.0.0.0, then I submit the code to build server, and the build server supposed to update the build number, so the AssemblyVersion of assembly on the repository will be 1.0.1.0, and AssemblyFileVersion is also supposed to be 1.0.1.0

Is my understanding correct? If not correct, I will be really appreciated if someone could explain based on my scenario above?

1

1 Answers

2
votes

AssemblyVersion like you mention is used by .NET to load the correct assembly. Assembly File Version is simply the version on the file that's used by Windows Explorer. .NET doesn't use this in any way. So if you make changes and in your daily builds for example, you will typically want to only increment the Assembly file version, rather than the Assembly Version, to avoid existing references breaking. This link gives a good explanation: https://docs.microsoft.com/en-us/troubleshoot/visualstudio/general/assembly-version-assembly-file-version