Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Development Edition
Design Warnings
 Mark assemblies with AssemblyVersio...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio Team System
Mark assemblies with AssemblyVersionAttribute

TypeName

MarkAssembliesWithAssemblyVersion

CheckId

CA1016

Category

Microsoft.Design

Breaking Change

Non Breaking

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 together 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..::.AssemblyVersionAttribute attribute. See the following example.

Do not suppress 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.

Visual Basic
Imports System
Imports System.Reflection

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

C#
using System;
using System.Reflection;

[assembly: AssemblyVersionAttribute("4.3.2.1")]
namespace DesignLibrary {}

Visual C++
using namespace System;
using namespace System::Reflection;

[assembly: AssemblyVersionAttribute("4.3.2.1")];
namespace DesignLibrary {}

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker