国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home 類庫(kù)下載 C# class library Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

Oct 14, 2016 pm 05:09 PM

Core code

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

開 Expand the code in the graph, look at the arrow ↓

using System.Reflection;
using System.Runtime.InteropServices;

// 有關(guān)程序集的常規(guī)信息通過(guò)下列特性集
// 控制。更改這些特性值可修改
// 與程序集關(guān)聯(lián)的信息。
[assembly: AssemblyTitle("MusicStore")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("MusicStore")]
[assembly: AssemblyCopyright("Copyright ? Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 將 ComVisible 設(shè)置為 false 會(huì)使此程序集中的類型
// 對(duì) COM 組件不可見。如果需要
// 從 COM 訪問此程序集中的某個(gè)類型,請(qǐng)針對(duì)該類型將 ComVisible 特性設(shè)置為 true。
[assembly: ComVisible(false)]

// 如果此項(xiàng)目向 COM 公開,則下列 GUID 用于 typelib 的 ID
[assembly: Guid("a9ef3281-9049-4a52-a2f1-2061d442200e")]

// 程序集的版本信息由下列四個(gè)值組成:
//
//      主版本
//      次版本
//      內(nèi)部版本號(hào)
//      修訂版本
//
// 可以指定所有值,也可以使用“修訂號(hào)”和“內(nèi)部版本號(hào)”的默認(rèn)值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
E

I. Global attributes

Most characteristics are suitable for specific language elements (such as class or methods), but some attributes are global they are applicable. to the entire assembly or module. For example: AssemblyVersionAttribute attribute can be used to embed version information into an assembly.

Global attributes appear in source code before any top-level using directives and before any type, module or namespace declarations. Global attributes can appear in multiple source files, however, the files must be compiled in a single compile pass. In C# projects, they are in the AssemblyInfo.cs file.

  Assembly attributes are values ??that provide information about the assembly. They are divided into the following categories:

 ?、貯ssembly identification characteristics

 ?、贗nformational characteristics

  ③Assembly manifest characteristics

 ?、躍trong name characteristics

 

 1. Assembly identification characteristics

 Three characteristics (use strong names , if applicable) Determine the assembly's identity: name, version, and culture. When referenced in code, these attributes form the full name of the assembly required. Using attributes, you can set the version and culture of an assembly. However, the name value is set by the compiler, in the Assembly Information dialog box of the Visual Studio IDE, after the assembly is created, according to the file that contains the assembly manifest. The AssemblyFlagsAttribute attribute specifies whether multiple copies of an assembly can coexist.

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

Figure - Correspondence between the nouns in the "Assembly Information" dialog box and the AssemblyInfo.cs file

2. Informational properties

You can use informational properties to provide information for an assembly Other company or product information.

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

  3. Assembly Manifest Feature

  You can use the assembly manifest feature to provide information in the assembly manifest. These include title, description, default alias, and configuration.

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

4. Strong name feature (not in depth)

Usually exists in earlier versions of Visual Studio. To use a strong-named assembly, perform the following assembly-level features:

 ?、貯ssemblyKeyFileAttribute

 ?、贏ssemblyKeyNameAttribute

  ③AssemblyDelaySignAttribute

This is still supported, however, the preferred method of signing an assembly is to use the Signature Page. (Not going into details here)

2. Obsolete features

The Obsolete attribute indicates that a program entity is marked as one that is no longer recommended for use. Each use of an entity marked as obsolete will subsequently generate a warning or error based on the configuration attribute.

/// <summary>
    /// 舊類
    /// </summary>
    [Obsolete("請(qǐng)使用 " + nameof(NewClass))]
    class OldClass
    {
        public void Method() { }
    }

    /// <summary>
    /// 新類
    /// </summary>
    class NewClass
    {
        [Obsolete("請(qǐng)使用 " + nameof(NewMethod), true)]
        public void OldMethod() { }

        public void NewMethod() { }
    }
rrree

Anatomy of AssemblyInfo.cs - Learn about commonly used attributes Attribute

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1502
276