Checking .Net assembly version

I am trying to fully understand build versions and strong names in .NET.

I found this version of the Versioning Article , indicating that only Major.Minor.Build is used in version matching. I can not find anything that could confirm / refute this.

Assembly version format ... Edition:
Assemblies with the same name, major and minor version numbers, but different versions be completely interchangeable. It would be advisable to fix the protective hole in the previously released assembly.

MS Articles say things like:

The version number of the assembly is part of the assembly identifier and plays a key role in binding to the assembly and in the version policy ... Version checking occurs only with nodes with strong names.

Does this mean that 1.0.0.0 and 1.0.0.1 are interchangeable in a strong namespace, but 1.0.1.1 is not?

What is the final answer please?

+4
source share
2 answers

I did not find anything in a related article that says that versioning uses only Major.Minor.Build. In fact, all four components of the version are used.

The key point is intended to be interchangeable . Regardless of whether they are truly interchangeable, it depends on the author who is free to respect or ignore the MS guidelines.

The general assembly provider installed in the GAC can provide a publisher policy file to redirect from the old to the new version of the assembly. He should only do this if the new version is backward compatible with the old one.

+2
source

Assembly AssemblyVersion -attribute is fully evaluated when comparing versions. This means that changing one part of the version number will result in inconsistent builds.

One way around this is to allow the unchanged AssemblyVersion attribute, for example, set to [AssemblyVersion("1.2.3.0")] and use the AssemblyFileVersion attribute to change versions, such as revisions, for example. [AssemblyFileVersion("1.2.3.20120909")] . This gives you the option to upgrade a version of a strongly named assembly without updating all references.

+3
source

Source: https://habr.com/ru/post/1433318/


All Articles