How to specify MajorRevision .NET assembly?

I am currently using AssemblyVersionAttributecompiled assemblies to indicate assembly versions. However, AssemblyVersionAttributeonly a 16-bit revision can be specified [1] . How can I specify MajorRevisionmore than zero?

+3
source share
1 answer

Properties MajorRevisionand MinorRevisionclass Versionare calculated from the properties of Revisionboth Revision >> 16and Revision & 0xffff, respectively (try mscorlib in Reflector).

Checking assembly versions does not support version numbers that are longer than 16 bits. This data is stored in a 16-bit section of the binary assembly. In other words, assembly versions only support a subset of the class’s capabilities Version. You can see this in the hex editor: setting the version, say 1.0.0.65534, will produce hex bytes in the compiled DLL 0100 0000 0000 feff. Trying to insert a value in the next two bytes, and then checking the assembly does not increment the version number by 16 bits.

+1
source