I have an assembly that is already built, but I need to modify it's version number. Is there a way to do this without recompiling?
- Dupe: stackoverflow.com/questions/398170/…David Basarab– David Basarab2009-09-03 01:02:22 +00:00Commented Sep 3, 2009 at 1:02
- Possible duplicate of Change Assembly Version in a compiled .NET assemblyLennart– Lennart2019-10-16 10:00:57 +00:00Commented Oct 16, 2019 at 10:00
1 Answer
The assembly version number is held in more than one place. The one that's reported with the assembly's strong name is in the Assembly metadata table (ECMA-335 §22.2). However, the one associated with the AssemblyVersionAttribute that you can access through code is located as a parameterized constructor argument in the "blob" data section (ECMA-335 §23.3). Since the number in both locations is a fixed number of bytes, you could change it without recompiling. However you would break the signature if you are signing the assemblies, so this action would need to be performed before signing the assembly.