Contecing identification attribute

xiaoxiao2021-03-06  64

The assembly attribute is the value of providing the assembly related information. The property is divided into the following sets of information:

The assembly identifies the properties. Information properties. The assembly list attribute. Strong name attribute.

Contecing identification attribute

Three attributes decide the identity of the assembly together with strong name (if applicable): Name, version, and regionality. These attributes constitute the full name of the assembly and need these attributes when referenced in the code. You can use properties to set the versions and regionality of the assembly. Compiler or

Contextile (Al.exe)

Depending on the file containing an assembly list, set the name value when creating an assembly, if one or more items in a solution are used to use other project order set, the version number is consistent.

The following code example illustrates how to apply version and regional properties to the assembly.

[Visual Basic]

'Set Version Number for the assembly.

'Set culture as german.

[C #]

// set Version Number for the assembly.

[Assembly: AssemblyVersionattribute ("4.3.2.1")]]]]

// SET CULTURE AS German.

[Assembly: AssemblyCultureAttribute ("de")]]]

Information properties

You can use the information properties to provide other companies or product information. The following table describes the information properties that can be applied to the assembly.

Information property description

AskEMBLYCOMPANYATTRIBUTE

Specifies the string value of the company name.

AskEMBLYCOPYRIGHTATTRIBUTE

Specify the string value of the copyright information.

AskEMBLYFILEVERSIONATTRIBUTE

Specifies the string value of the Win32 file version number. The default is usually an assembly version.

AssemblyInformationalVersionAttribute

Specify the string value of the version information that is not used at runtime, for example, the complete product version number.

AskEMBLYPRODUCTATTRIBUTE

Specify the string value of product information.

AskEMBLYTRADEMARKATTRIBUTE

Specifies the string value of the trademark information.

These properties can be displayed on the "Windows Properties" page of the assembly, or use the / Win32RES compiler option to specify your Win32 resource file to rewrite these properties.

Program collection list attribute

You can use the program set clearance attribute to provide information in the assembly list, including title, description, default alias, and configuration. The following table describes the properties of the assembly list.

Program set clearance property description

AskEMBLYCONFIGURATIONATTRIBUTE

Indicates a string value configured by the assembly, such as Retail or Debug. This value is not used when running.

AskEMBLYDEFAULTALIASATTRIBUTE

Specifies the string value of the default alias to use by the reference assembly. This value provides friendly names, such as GUID values ​​when the name of the assembly itself is unfamiliar. This value can also be used as an abbreviation for the full assembly name.

AskEMBLYDESBRIPTIONATTRIBUTE

Specifies a string value of the character string value of the characteristics of summary assembly.

AskEMBLYTITRIBUTE

Specify a string value of the friendly name for the assembly. For example, an assembly called COMDLG can have title "Microsoft Common Dialog Control".

Strong name attribute

You can use strong name properties to set a strong name for the assembly. The following table describes a strong name property.

Strong Name Property Description

AskEDELAYSIGNATTRIBUTE

Indicates the Boolean value that is using the delayed signature.

AskEMBLYKEYFILEATTRIBUTE

Indicates the string value of the file name, in which the public key is included (if a delay signature is used), or the public key and private key are transmitted to this attribute. Note that the file name is related to the output file path (.exe or .dll), regardless of the source file path. AskEMBLYKEYNAMEATTRIBUTE

Indicates a key container containing a key pair (as a configuration function that is passed to this attribute).

The following code example illustrates the properties to be applied when using the delay signature to create a strong name assembly named myKey.snk.

[Visual Basic]

[C #]

[assmbly: assemblykeyKeyFileAttribute (@ "../../ mykey.snk")]

[assmbly: assemblydelaysignattribute (true)]

转载请注明原文地址:https://www.9cbs.com/read-89246.html

New Post(0)