NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

AssemblyName Class

This class fully describes an assembly's unique identity. An assembly's identity consists of several pieces of information including a simple textual name, a version number, a cryptographic key pair, and supported culture.

Object
   AssemblyName

[Visual Basic]
Public Class AssemblyName
   Implements ICloneable
[C#]
public class AssemblyName : ICloneable
[C++]
public __gc class AssemblyName : public ICloneable
[JScript]
public class AssemblyName implements ICloneable

Remarks

The AssemblyName class is used for binding and retrieving information about an assembly. The AssemblyName class is used to interface with the assembly cache manager.

The friendly textual name of an assembly is called simple name. A name secured with a public and private cryptographic key pair is called strong name.

A fully specified AssemblyName must have the following parameters: name, culture, originator, major version, minor version, revision number, and build number. The last four are packaged in the Version type.

An AssemblyName may specify a partial query in that an insufficient number of parameters is supplied to explicitly determine a unique assembly. The AssemblyName is used by the assembly cache manager to bind to an assembly, given other information such as application assembly deployment and assembly cache state. The assembly cache manager will return the first assembly that matches the specified AssemblyName. The order in which the parameters may be specified in partial assembly name references is restricted to the order specified above. For example, it is permissible to specify and match on name, culture, originator with the version parameters omitted, but it is not permissible to match on name and originator, omitting both culture and the version. When used for binding the name is the minimal requirement

To create a simple name, create an AssemblyName object using the default constructor and set the Name. The other properties are optional.

To create a full strong name, create an AssemblyName object using the default constructor and set the Name and KeyPair. The other properties are optional. The Originator will be set for you. The strong name signing always uses the SHA1 hash algorithm.

For a partial specified strong name, create an AssemblyName object using the default constructor and set the Name and Originator. The other properties are optional. An assembly created using such an AssemblyName can be signed later using the LM tool.

It is possible to specify an Originator and a KeyPair with inconsistent values. This is useful in developer scenarios. In this case the Originator specifies the correct public key while the KeyPair specifies the public and private keys used during development. When the runtime detects a mismatch between the KeyPair and the Originator, it looks up in the registry the correct key that matches the Originator.

The format of the display name of an AssemblyName is a comma delimited Unicode string that begins with the name.

Name <,Loc = CultureInfo> <,Ver = Major.Minor.Revision.Build> <,SN = StrongName> <,PK = PublicKey> '\0'

Name is the textual name of the assembly. CultureInfo is the RFC1766 format defined culture. StrongName is the hexadecimal-encoded low-order 64 bits of the hash value of the Originator generated using the SHA-1 hashing algorithm and the public key specified by the Originator. Major, Minor, Revision, and Build are the major version, minor version, revision number, and build number of the assembly. PublicKey is the hexadecimal-encoded public key specified by the Originator.

Quoted values are optional. Hexadecimal encoding is defined as the conversion of each byte of a binary object to two hexadecimal characters, progressing from least to most significant byte. Additional display values will be added as deemed necessary.

If the full public key is known then PK (public key) may be substituted for SN.

Also note that except for name which must come first, the lexical order of parameters as specified in the string is unimportant.

However, any parameter (Ver, Loc, SN or PK) not specifically set is considered to be omitted and the AssemblyName is considered partial. When specifying partial information, name parameters must be specified in the order described previously.

When supplying a display name, the convention SN=null or PK=null, indicates that binding and matching against a simply named assembly is required. Additionally, the convention Loc= "" (double quote representing empty string) indicates matching against the default culture.

1. Example of fully specified AssemblyName for simply named assembly with default locale:

com.microsoft.crypto, Loc="", SN=null, Ver=1.0.0.0,

2. Example of fully specified ref for strongly named assembly with locale "en":

com.microsoft.crypto, Loc=en, SN=a5d015c7d5a0b012, Ver=1.0.0.0

3. Examples of partially specified AssemblyName, may be satisfied by either strong or simply named assembly:

com.microsoft.crypto

com.microsoft.crypto, Loc=""

com.microsoft.crypto, Loc=en

4. Examples of partially specified AssemblyName, must be satisfied by simply named assembly:

com.microsoft.crypto, Loc="", SN=null

com.microsoft.crypto, Loc=en, SN=null, Ver=1.0

5. Examples of partially specified AssemblyName, must be satisfied by strongly named assembly:

com.microsoft.crypto, Loc="", SN=a5d015c7d5a0b012

com.microsoft.crypto, Loc=en, SN=a5d015c7d5a0b012, Ver=1.0

Requirements

Namespace: System.Reflection

Assembly: mscorlib.dll

See Also

AssemblyName Members | System.Reflection Namespace