Export (0) Print
Expand All

AssemblyDescriptionAttribute Class

Provides a text description for an assembly.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false)] 
public sealed class AssemblyDescriptionAttribute : Attribute
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false) */ 
public final class AssemblyDescriptionAttribute extends Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false) 
public final class AssemblyDescriptionAttribute extends Attribute

When you create a project in Microsoft Visual Studio 2005, this attribute is automatically applied with an empty string value. You can set its value in Visual Studio 2005 by selecting the Properties for the project from the File menu, and then by clicking Assembly Information. The attribute is saved in the AssemblyInfo file in your project, and it must be removed before you can specify it in code; otherwise, you will get an error that the attribute cannot be applied multiple times.

When you right-click the assembly file in Windows Explorer, this attribute appears as the Comments value on the Version tab of the file properties dialog box.

The following code example sets the AssemblyDescriptionAttribute for a simple assembly and indicates whether or not it was defined.

using System;
using System.Reflection;

[assembly:AssemblyDescriptionAttribute("My Utility")]
public class Test {

    public static void Main() {
        //  Get the assembly.
        Assembly asm = Assembly.GetCallingAssembly();

        //  Verify that the description is applied.
        Type aType = typeof(AssemblyDescriptionAttribute);
        Console.WriteLine("Description applied: {0}", asm.IsDefined(aType, false));
    }
}
//  The output is:
//  Description Applied: True
//
//

System.Object
   System.Attribute
    System.Reflection.AssemblyDescriptionAttribute

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft