I have a 3rd party C++/CLR assembly. When I right click the dll, the version tab shows 5.32.1 but when the meta information in ILSpy shows 5.0.0. Why is this difference? Which one is the one that is correct?
1 Answers
The file version as it's shown in property tab of Windows Explorer corresponds to the .NET assembly AssemblyInformationalVersion
attribute. AssemblyVersion
is a separate independent thing.
And of course, neither of the two is more correct than the other one, the developer can set them independently.
For the AssemblyVersion
the current practice seems to be roughly "the assemblies with the same major.minor version should be compatible", but nothing really enforces this rule.
Necessary correction: Actually, the policy enforced by the current CLR assembly binding is that the whole assembly version should match in order to be loadable, so the compatible assemblies should have the same assembly version. More on the topic: What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion?
-
When I use codebase tag for a version, I know it uses the AssemblyVersion to match and load the file otherwise fails. – user236215 Oct 29 '12 at 23:13
-
I;ve run into problems when I relied on AssemblyInformationalversion in my config to load the file....and it fails. Alas its Microsoft.. – user236215 Oct 29 '12 at 23:15
-
yes, when you reference a .NET assembly, you _may_ say that you want a specific version – Vlad Oct 29 '12 at 23:15
-
app.config, publisher policy, machine.config - all interpret version attribute as AssemblyVersion – user236215 Oct 29 '12 at 23:23
-
@user: oh yes, in the .NET world `AssemblyInformationalVersion` seems to be neglected, and exists perhaps only for the property tab display. Seems to be quite strange. – Vlad Oct 29 '12 at 23:25
-
@user: ([this link](http://msdn.microsoft.com/en-us/library/51ket42z.aspx) might be somewhat helpful) – Vlad Oct 29 '12 at 23:28