The AssemblyVersion attribute is used to specify the version number of an assembly. An assembly is a compiled unit of code, which can be marked with a version number by applying the attribute to an assembly’s source code file.
The AssemblyVersion attribute is useful for many reasons:
AssemblyVersion attribute, you can ensure that the correct version of the referenced assembly is used. This
helps avoid compatibility issues and ensures that the expected behavior and functionality are maintained. If no AssemblyVersion is provided, the same default version will be used for every build. Since the version number is used by .NET
Framework to uniquely identify an assembly, this can lead to broken dependencies.
Imports System.Reflection
<Assembly: AssemblyTitle("MyAssembly")> ' Noncompliant
Namespace MyLibrary
' ...
End Namespace
Imports System.Reflection
<Assembly: AssemblyTitle("MyAssembly")>
<Assembly: AssemblyVersion("42.1.125.0")>
Namespace MyLibrary
' ...
End Namespace