How do I change the version number of an assembly after a build?

I have an assembly that is already built, but I need to change its version number. Is there a way to do this without recompiling?

+2


source to share


2 answers


According to this answer, you can.



+2


source


The assembly version number is held in several places. The one reported with a strong assembly name is in the Assembly metadata table (ECMA-335 ยง22.2). However, the one linked to AssemblyVersionAttribute

, which you can get through code, is in the parameterized constructor argument in the "blob" data section (ECMA-335, ยง23.3). Since the number in both places is a fixed number of bytes, you can change it without recompiling. However, you must break the signature if you are signing assemblies, so this step must be performed before signing the assembly.



+1


source







All Articles