18 [__DynamicallyInvokable]
23 private byte[] _PublicKey;
25 private byte[] _PublicKeyToken;
29 private string _CodeBase;
37 private byte[] _HashForControl;
49 [__DynamicallyInvokable]
52 [__DynamicallyInvokable]
57 [__DynamicallyInvokable]
66 [__DynamicallyInvokable]
69 [__DynamicallyInvokable]
74 [__DynamicallyInvokable]
83 [__DynamicallyInvokable]
86 [__DynamicallyInvokable]
91 [__DynamicallyInvokable]
100 [__DynamicallyInvokable]
103 [__DynamicallyInvokable]
106 if (_CultureInfo !=
null)
108 return _CultureInfo.
Name;
112 [__DynamicallyInvokable]
115 _CultureInfo = ((value ==
null) ?
null :
new CultureInfo(value));
137 [SecuritySafeCritical]
140 if (_CodeBase ==
null)
144 return EscapeCodeBase(_CodeBase);
150 [__DynamicallyInvokable]
153 [__DynamicallyInvokable]
163 [__DynamicallyInvokable]
179 [__DynamicallyInvokable]
182 [__DynamicallyInvokable]
192 [__DynamicallyInvokable]
206 [__DynamicallyInvokable]
209 [__DynamicallyInvokable]
214 [__DynamicallyInvokable]
228 return _HashAlgorithm;
232 _HashAlgorithm = value;
242 return _VersionCompatibility;
246 _VersionCompatibility = value;
256 return _StrongNameKeyPair;
260 _StrongNameKeyPair = value;
266 [__DynamicallyInvokable]
269 [SecuritySafeCritical]
270 [__DynamicallyInvokable]
273 string text = nToString();
274 if (CompatibilitySwitches.IsAppEarlierThanWindowsPhone8 &&
string.IsNullOrEmpty(text))
276 return base.ToString();
283 [__DynamicallyInvokable]
296 assemblyName.Init(_Name, _PublicKey, _PublicKeyToken, _Version, _CultureInfo, _HashAlgorithm, _VersionCompatibility, _CodeBase, _Flags, _StrongNameKeyPair);
297 assemblyName._HashForControl = _HashForControl;
298 assemblyName._HashAlgorithmForControl = _HashAlgorithmForControl;
315 [SecuritySafeCritical]
318 if (assemblyFile ==
null)
322 string fullPathInternal =
Path.GetFullPathInternal(assemblyFile);
324 return nGetFileInformation(fullPathInternal);
329 _HashForControl = hash;
330 _HashAlgorithmForControl = hashAlgorithm;
336 [__DynamicallyInvokable]
344 [__DynamicallyInvokable]
347 _PublicKey = publicKey;
348 if (publicKey ==
null)
360 [SecuritySafeCritical]
361 [__DynamicallyInvokable]
364 if (_PublicKeyToken ==
null)
366 _PublicKeyToken = nGetPublicKeyToken();
368 return _PublicKeyToken;
373 [__DynamicallyInvokable]
376 _PublicKeyToken = publicKeyToken;
381 [__DynamicallyInvokable]
385 if (fullName ==
null)
387 return base.ToString();
404 info.AddValue(
"_Name", _Name);
405 info.AddValue(
"_PublicKey", _PublicKey, typeof(
byte[]));
406 info.AddValue(
"_PublicKeyToken", _PublicKeyToken, typeof(
byte[]));
407 info.AddValue(
"_CultureInfo", (_CultureInfo ==
null) ? (-1) : _CultureInfo.
LCID);
408 info.AddValue(
"_CodeBase", _CodeBase);
409 info.AddValue(
"_Version", _Version);
412 info.AddValue(
"_StrongNameKeyPair", _StrongNameKeyPair, typeof(
StrongNameKeyPair));
415 info.AddValue(
"_HashForControl", _HashForControl, typeof(
byte[]));
422 if (m_siInfo !=
null)
425 _PublicKey = (
byte[])m_siInfo.
GetValue(
"_PublicKey", typeof(
byte[]));
426 _PublicKeyToken = (
byte[])m_siInfo.
GetValue(
"_PublicKeyToken", typeof(
byte[]));
427 int @
int = m_siInfo.
GetInt32(
"_CultureInfo");
432 _CodeBase = m_siInfo.
GetString(
"_CodeBase");
441 _HashForControl = (
byte[])m_siInfo.
GetValue(
"_HashForControl", typeof(
byte[]));
446 _HashForControl =
null;
465 [SecuritySafeCritical]
466 [__DynamicallyInvokable]
469 if (assemblyName ==
null)
473 if (assemblyName.Length == 0 || assemblyName[0] ==
'\0')
477 _Name = assemblyName;
486 [SecuritySafeCritical]
489 if (reference == definition)
493 return ReferenceMatchesDefinitionInternal(reference, definition, parse:
true);
497 [SecuritySafeCritical]
498 internal static extern bool ReferenceMatchesDefinitionInternal(
AssemblyName reference,
AssemblyName definition,
bool parse);
502 internal extern void nInit(out RuntimeAssembly assembly,
bool forIntrospection,
bool raiseResolveEvent);
505 internal void nInit()
507 RuntimeAssembly assembly =
null;
508 nInit(out assembly, forIntrospection:
false, raiseResolveEvent:
false);
562 if (publicKey !=
null)
564 _PublicKey =
new byte[publicKey.Length];
565 Array.Copy(publicKey, _PublicKey, publicKey.Length);
567 if (publicKeyToken !=
null)
569 _PublicKeyToken =
new byte[publicKeyToken.Length];
570 Array.Copy(publicKeyToken, _PublicKeyToken, publicKeyToken.Length);
576 _CultureInfo = cultureInfo;
577 _HashAlgorithm = hashAlgorithm;
578 _VersionCompatibility = versionCompatibility;
579 _CodeBase = codeBase;
581 _StrongNameKeyPair = keyPair;
589 throw new NotImplementedException();
599 throw new NotImplementedException();
611 throw new NotImplementedException();
624 void _AssemblyName.
Invoke(uint dispIdMember, [
In] ref Guid riid, uint lcid,
short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
626 throw new NotImplementedException();
629 internal string GetNameWithPublicKey()
632 return Name +
", PublicKey=" + Hex.EncodeHexString(publicKey);
637 internal static extern AssemblyName nGetFileInformation(
string s);
641 private extern string nToString();
645 private extern byte[] nGetPublicKeyToken();
649 internal static extern string EscapeCodeBase(
string codeBase);
AssemblyContentType
Provides information about the type of code contained in an assembly.
object Clone()
Makes a copy of this T:System.Reflection.AssemblyName object.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
FileIOPermissionAccess
Specifies the type of file access requested.
string EscapedCodeBase
Gets the URI, including escape characters, that represents the codebase.
AssemblyName()
Initializes a new instance of the T:System.Reflection.AssemblyName class.
string? CultureName
Gets or sets the name of the culture associated with the assembly.
AssemblyHashAlgorithm HashAlgorithm
Gets or sets the hash algorithm used by the assembly manifest.
Indicates that a class is to be notified when deserialization of the entire object graph has been com...
Encapsulates access to a public or private key pair used to sign strong name assemblies.
void Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
Provides access to properties and methods exposed by an object.
AssemblyContentType ContentType
Gets or sets a value that indicates what type of content the assembly contains.
ImageFileMachine
Identifies the platform targeted by an executable.
AssemblyName(string assemblyName)
Initializes a new instance of the T:System.Reflection.AssemblyName class with the specified display n...
virtual string Name
Gets the culture name in the format languagecode2-country/regioncode2.
AssemblyNameFlags
Provides information about an T:System.Reflection.Assembly reference.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Version Version
Gets or sets the major, minor, build, and revision numbers of the assembly.
AssemblyNameFlags Flags
Gets or sets the attributes of the assembly.
AssemblyVersionCompatibility VersionCompatibility
Gets or sets the information related to the assembly's compatibility with other assemblies.
Provides information about, and means to manipulate, the current environment and platform....
string Name
Gets or sets the simple name of the assembly. This is usually, but not necessarily,...
static bool ReferenceMatchesDefinition(AssemblyName reference, AssemblyName definition)
Returns a value indicating whether two assembly names are the same. The comparison is based on the si...
static AssemblyName GetAssemblyName(string assemblyFile)
Gets the T:System.Reflection.AssemblyName for a given file.
void SetPublicKey(byte[] publicKey)
Sets the public key identifying the assembly.
CultureInfo CultureInfo
Gets or sets the culture supported by the assembly.
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
void GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo)
Retrieves the type information for an object, which can be used to get the type information for an in...
override string ToString()
Returns the full name of the assembly, also known as the display name.
Represents the version number of an assembly, operating system, or the common language runtime....
The exception thrown when an error occurs during serialization or deserialization.
MethodImplOptions
Defines the details of how a method is implemented.
StrongNameKeyPair KeyPair
Gets or sets the public and private cryptographic key pair that is used to create a strong name signa...
AssemblyVersionCompatibility
Defines the different types of assembly version compatibility. This feature is not available in versi...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
void GetObjectData(SerializationInfo info, StreamingContext context)
Gets serialization information with all the data needed to recreate an instance of this AssemblyName.
byte [] GetPublicKey()
Gets the public key of the assembly.
string CodeBase
Gets or sets the location of the assembly as a URL.
Describes an assembly's unique identity in full.
The exception that is thrown when one of the arguments provided to a method is not valid.
void Demand()
Forces a T:System.Security.SecurityException at run time if all callers higher in the call stack have...
void GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
Maps a set of names to a corresponding set of dispatch identifiers.
Allows an object to control its own serialization and deserialization.
string GetString(string name)
Retrieves a T:System.String value from the T:System.Runtime.Serialization.SerializationInfo store.
PortableExecutableKinds
Identifies the nature of the code in an executable file.
object GetValue(string name, Type type)
Retrieves a value from the T:System.Runtime.Serialization.SerializationInfo store.
Specifies that the class can be serialized.
virtual int LCID
Gets the culture identifier for the current T:System.Globalization.CultureInfo.
ClassInterfaceType
Identifies the type of class interface that is generated for a class.
int GetInt32(string name)
Retrieves a 32-bit signed integer value from the T:System.Runtime.Serialization.SerializationInfo sto...
Specifies that the parameter is an input parameter.
object Clone()
Returns a new T:System.Version object whose value is the same as the current T:System....
void OnDeserialization(object sender)
Implements the T:System.Runtime.Serialization.ISerializable interface and is called back by the deser...
Provides information about a specific culture (called a locale for unmanaged code development)....
Controls the ability to access files and folders. This class cannot be inherited.
ProcessorArchitecture ProcessorArchitecture
Gets or sets a value that identifies the processor and bits-per-word of the platform targeted by an e...
ProcessorArchitecture
Identifies the processor and bits-per-word of the platform targeted by an executable.
Exposes the T:System.Reflection.AssemblyName class to unmanaged code.
void GetTypeInfoCount(out uint pcTInfo)
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
Performs operations on T:System.String instances that contain file or directory path information....
byte [] GetPublicKeyToken()
Gets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which ...
string FullName
Gets the full name of the assembly, also known as the display name.
AssemblyHashAlgorithm
Specifies all the hash algorithms used for hashing files and for generating the strong name.
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 ...