mscorlib(4.0.0.0) API with additions
System.Reflection.AssemblyName Class Reference

Describes an assembly's unique identity in full. More...

Inheritance diagram for System.Reflection.AssemblyName:
[legend]
Collaboration diagram for System.Reflection.AssemblyName:
[legend]

Public Member Functions

 AssemblyName ()
 Initializes a new instance of the T:System.Reflection.AssemblyName class. More...
 
object Clone ()
 Makes a copy of this T:System.Reflection.AssemblyName object. More...
 
byte [] GetPublicKey ()
 Gets the public key of the assembly. More...
 
void SetPublicKey (byte[] publicKey)
 Sets the public key identifying the assembly. More...
 
byte [] GetPublicKeyToken ()
 Gets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. More...
 
void SetPublicKeyToken (byte[] publicKeyToken)
 Sets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. More...
 
override string ToString ()
 Returns the full name of the assembly, also known as the display name. More...
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 Gets serialization information with all the data needed to recreate an instance of this AssemblyName. More...
 
void OnDeserialization (object sender)
 Implements the T:System.Runtime.Serialization.ISerializable interface and is called back by the deserialization event when deserialization is complete. More...
 
 AssemblyName (string assemblyName)
 Initializes a new instance of the T:System.Reflection.AssemblyName class with the specified display name. More...
 

Static Public Member Functions

static AssemblyName GetAssemblyName (string assemblyFile)
 Gets the T:System.Reflection.AssemblyName for a given file. More...
 
static bool ReferenceMatchesDefinition (AssemblyName reference, AssemblyName definition)
 Returns a value indicating whether two assembly names are the same. The comparison is based on the simple assembly names. More...
 

Properties

string Name [get, set]
 Gets or sets the simple name of the assembly. This is usually, but not necessarily, the file name of the manifest file of the assembly, minus its extension. More...
 
Version Version [get, set]
 Gets or sets the major, minor, build, and revision numbers of the assembly. More...
 
CultureInfo CultureInfo [get, set]
 Gets or sets the culture supported by the assembly. More...
 
string? CultureName [get, set]
 Gets or sets the name of the culture associated with the assembly. More...
 
string CodeBase [get, set]
 Gets or sets the location of the assembly as a URL. More...
 
string EscapedCodeBase [get]
 Gets the URI, including escape characters, that represents the codebase. More...
 
ProcessorArchitecture ProcessorArchitecture [get, set]
 Gets or sets a value that identifies the processor and bits-per-word of the platform targeted by an executable. More...
 
AssemblyContentType ContentType [get, set]
 Gets or sets a value that indicates what type of content the assembly contains. More...
 
AssemblyNameFlags Flags [get, set]
 Gets or sets the attributes of the assembly. More...
 
AssemblyHashAlgorithm HashAlgorithm [get, set]
 Gets or sets the hash algorithm used by the assembly manifest. More...
 
AssemblyVersionCompatibility VersionCompatibility [get, set]
 Gets or sets the information related to the assembly's compatibility with other assemblies. More...
 
StrongNameKeyPair KeyPair [get, set]
 Gets or sets the public and private cryptographic key pair that is used to create a strong name signature for the assembly. More...
 
string FullName [get]
 Gets the full name of the assembly, also known as the display name. More...
 

Detailed Description

Describes an assembly's unique identity in full.

Definition at line 19 of file AssemblyName.cs.

Constructor & Destructor Documentation

◆ AssemblyName() [1/2]

System.Reflection.AssemblyName.AssemblyName ( )

Initializes a new instance of the T:System.Reflection.AssemblyName class.

Definition at line 284 of file AssemblyName.cs.

◆ AssemblyName() [2/2]

System.Reflection.AssemblyName.AssemblyName ( string  assemblyName)

Initializes a new instance of the T:System.Reflection.AssemblyName class with the specified display name.

Parameters
assemblyNameThe display name of the assembly, as returned by the P:System.Reflection.AssemblyName.FullName property.
Exceptions
T:System.ArgumentNullExceptionassemblyName is null.
T:System.ArgumentExceptionassemblyName is a zero length string.
T:System.IO.FileLoadExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.IO.IOException, instead.The referenced assembly could not be found, or could not be loaded.

Definition at line 467 of file AssemblyName.cs.

Member Function Documentation

◆ Clone()

object System.Reflection.AssemblyName.Clone ( )

Makes a copy of this T:System.Reflection.AssemblyName object.

Returns
An object that is a copy of this T:System.Reflection.AssemblyName object.

Implements System.ICloneable.

Definition at line 293 of file AssemblyName.cs.

◆ GetAssemblyName()

static AssemblyName System.Reflection.AssemblyName.GetAssemblyName ( string  assemblyFile)
static

Gets the T:System.Reflection.AssemblyName for a given file.

Parameters
assemblyFileThe path for the assembly whose T:System.Reflection.AssemblyName is to be returned.
Returns
An object that represents the given assembly file.
Exceptions
T:System.ArgumentNullExceptionassemblyFile is null.
T:System.ArgumentExceptionassemblyFile is invalid, such as an assembly with an invalid culture.
T:System.IO.FileNotFoundExceptionassemblyFile is not found.
T:System.Security.SecurityExceptionThe caller does not have path discovery permission.
T:System.BadImageFormatExceptionassemblyFile is not a valid assembly.
T:System.IO.FileLoadExceptionAn assembly or module was loaded twice with two different sets of evidence.

Definition at line 316 of file AssemblyName.cs.

◆ GetObjectData()

void System.Reflection.AssemblyName.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Gets serialization information with all the data needed to recreate an instance of this AssemblyName.

Parameters
infoThe object to be populated with serialization information.
contextThe destination context of the serialization.
Exceptions
T:System.ArgumentNullExceptioninfo is null.

Implements System.Runtime.Serialization.ISerializable.

Definition at line 398 of file AssemblyName.cs.

◆ GetPublicKey()

byte [] System.Reflection.AssemblyName.GetPublicKey ( )

Gets the public key of the assembly.

Returns
A byte array that contains the public key of the assembly.
Exceptions
T:System.Security.SecurityExceptionA public key was provided (for example, by using the M:System.Reflection.AssemblyName.SetPublicKey(System.Byte[]) method), but no public key token was provided.

Definition at line 337 of file AssemblyName.cs.

◆ GetPublicKeyToken()

byte [] System.Reflection.AssemblyName.GetPublicKeyToken ( )

Gets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed.

Returns
A byte array that contains the public key token.

Definition at line 362 of file AssemblyName.cs.

◆ OnDeserialization()

void System.Reflection.AssemblyName.OnDeserialization ( object  sender)

Implements the T:System.Runtime.Serialization.ISerializable interface and is called back by the deserialization event when deserialization is complete.

Parameters
senderThe source of the deserialization event.

Implements System.Runtime.Serialization.IDeserializationCallback.

Definition at line 420 of file AssemblyName.cs.

◆ ReferenceMatchesDefinition()

static bool System.Reflection.AssemblyName.ReferenceMatchesDefinition ( AssemblyName  reference,
AssemblyName  definition 
)
static

Returns a value indicating whether two assembly names are the same. The comparison is based on the simple assembly names.

Parameters
referenceThe reference assembly name.
definitionThe assembly name that is compared to the reference assembly.
Returns
true if the simple assembly names are the same; otherwise, false.

Definition at line 487 of file AssemblyName.cs.

◆ SetPublicKey()

void System.Reflection.AssemblyName.SetPublicKey ( byte []  publicKey)

Sets the public key identifying the assembly.

Parameters
publicKeyA byte array containing the public key of the assembly.

Definition at line 345 of file AssemblyName.cs.

◆ SetPublicKeyToken()

void System.Reflection.AssemblyName.SetPublicKeyToken ( byte []  publicKeyToken)

Sets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed.

Parameters
publicKeyTokenA byte array containing the public key token of the assembly.

Definition at line 374 of file AssemblyName.cs.

◆ ToString()

override string System.Reflection.AssemblyName.ToString ( )

Returns the full name of the assembly, also known as the display name.

Returns
The full name of the assembly, or the class name if the full name cannot be determined.

Definition at line 382 of file AssemblyName.cs.

Property Documentation

◆ CodeBase

string System.Reflection.AssemblyName.CodeBase
getset

Gets or sets the location of the assembly as a URL.

Returns
A string that is the URL location of the assembly.

Definition at line 122 of file AssemblyName.cs.

◆ ContentType

AssemblyContentType System.Reflection.AssemblyName.ContentType
getset

Gets or sets a value that indicates what type of content the assembly contains.

Returns
A value that indicates what type of content the assembly contains.

Definition at line 181 of file AssemblyName.cs.

◆ CultureInfo

CultureInfo System.Reflection.AssemblyName.CultureInfo
getset

Gets or sets the culture supported by the assembly.

Returns
An object that represents the culture supported by the assembly.

Definition at line 85 of file AssemblyName.cs.

◆ CultureName

string? System.Reflection.AssemblyName.CultureName
getset

Gets or sets the name of the culture associated with the assembly.

Returns
The culture name.

Definition at line 102 of file AssemblyName.cs.

◆ EscapedCodeBase

string System.Reflection.AssemblyName.EscapedCodeBase
get

Gets the URI, including escape characters, that represents the codebase.

Returns
A URI with escape characters.

Definition at line 136 of file AssemblyName.cs.

◆ Flags

AssemblyNameFlags System.Reflection.AssemblyName.Flags
getset

Gets or sets the attributes of the assembly.

Returns
A value that represents the attributes of the assembly.

Definition at line 208 of file AssemblyName.cs.

◆ FullName

string System.Reflection.AssemblyName.FullName
get

Gets the full name of the assembly, also known as the display name.

Returns
A string that is the full name of the assembly, also known as the display name.

Definition at line 268 of file AssemblyName.cs.

◆ HashAlgorithm

AssemblyHashAlgorithm System.Reflection.AssemblyName.HashAlgorithm
getset

Gets or sets the hash algorithm used by the assembly manifest.

Returns
The hash algorithm used by the assembly manifest.

Definition at line 225 of file AssemblyName.cs.

◆ KeyPair

StrongNameKeyPair System.Reflection.AssemblyName.KeyPair
getset

Gets or sets the public and private cryptographic key pair that is used to create a strong name signature for the assembly.

Returns
The public and private cryptographic key pair to be used to create a strong name for the assembly.

Definition at line 253 of file AssemblyName.cs.

◆ Name

string System.Reflection.AssemblyName.Name
getset

Gets or sets the simple name of the assembly. This is usually, but not necessarily, the file name of the manifest file of the assembly, minus its extension.

Returns
The simple name of the assembly.

Definition at line 51 of file AssemblyName.cs.

◆ ProcessorArchitecture

ProcessorArchitecture System.Reflection.AssemblyName.ProcessorArchitecture
getset

Gets or sets a value that identifies the processor and bits-per-word of the platform targeted by an executable.

Returns
One of the enumeration values that identifies the processor and bits-per-word of the platform targeted by an executable.

Definition at line 152 of file AssemblyName.cs.

◆ Version

Version System.Reflection.AssemblyName.Version
getset

Gets or sets the major, minor, build, and revision numbers of the assembly.

Returns
An object that represents the major, minor, build, and revision numbers of the assembly.

Definition at line 68 of file AssemblyName.cs.

◆ VersionCompatibility

AssemblyVersionCompatibility System.Reflection.AssemblyName.VersionCompatibility
getset

Gets or sets the information related to the assembly's compatibility with other assemblies.

Returns
A value that represents information about the assembly's compatibility with other assemblies.

Definition at line 239 of file AssemblyName.cs.


The documentation for this class was generated from the following file: