Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Mark assemblies with assembly version

TypeName

MarkAssembliesWithAssemblyVersion

CheckId

CA1016

Category

Microsoft.Design

Breaking Change

NonBreaking

The assembly does not have a version number.

The identity of an assembly is composed of the following information:

  • Assembly name

  • Version number

  • Culture

  • Public key (for strong-named assemblies).

The .NET Framework uses the version number to uniquely identify an assembly, and to bind to types in strong-named assemblies. The version number is used toghether with version and publisher policy. By default, applications run only with the assembly version with which they were built.

To fix a violation of this rule, add a version number to the assembly using the System.Reflection.AssemblyKeyFileAttribute attribute. See the followihg example.

Do not exclude a warning from this rule for assemblies that are used by third parties, or in a production environment.

The following example shows an assemble with the AssemblyVersionAttribute attribute applied.

Imports System
Imports System.Reflection

<Assembly: AssemblyVersionAttribute("4.3.2.1")>
Namespace DesignLibrary
End Namespace

Community Additions

ADD
Show:
© 2015 Microsoft