Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application.
See Also: Assembly
public abstract class Assembly : ICustomAttributeProvider, _Assembly, ISerializable, IEvidenceFactory
Use the Assembly class to load assemblies, to explore the metadata and constituent parts of assemblies, to discover the types contained in assemblies, and to create instances of those types.
To get an array of Assembly objects representing the assemblies currently loaded into an application domain (for example, the default application domain of a simple project), use the AppDomain.GetAssemblies method.
To load assemblies dynamically, the Assembly class provides the following static methods (Shared methods in Visual Basic). Assemblies are loaded into the application domain where the load operation occurs.
The recommended way to load assemblies is to use the erload:System.AppDomain.Load method, which identifies the assembly to be loaded by its display name (for example, "System.Windows.Forms, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089"). The search for the assembly follows the rules described in How the Runtime Locates Assemblies.
The erload:System.Reflection.Assembly.ReflectionOnlyLoad and Assembly.ReflectionOnlyLoadFrom(String) methods enable you to load an assembly for reflection, but not for execution. For example, an assembly that targets a 64-bit platform can be examined by code that is running on a 32-bit platform.
Many members of the Assembly class provide information about an assembly. For example:
The erload:System.Reflection.Assembly.GetCustomAttributes method lists the attributes applied to the assembly.
The erload:System.Reflection.Assembly.GetFiles method provides access to the files in the assembly manifest.
The Assembly.GetManifestResourceNames method provides the names of the resources in the assembly manifest.
The Assembly.GetTypes method lists all the types in the assembly. The Assembly.GetExportedTypes method lists the types that are visible to callers outside the assembly. The erload:System.Reflection.Assembly.GetType method can be used to search for a particular type in the assembly. The erload:System.Reflection.Assembly.CreateInstance method can be used to search for and create instances of types in the assembly.
For more information on assemblies, see Application Domains and Assemblies.
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 126.96.36.199, 188.8.131.52
The members of System.Reflection.Assembly are listed below.
See Also: Object
Gets the location of the assembly as specified originally, for example, in an AssemblyName object.
Gets a collection that contains this assembly's custom attributes.
Gets a collection of the types defined in this assembly.
Gets the entry point of this assembly.
Gets the URI, including escape characters, that represents the codebase.
Gets the evidence for this assembly.
Gets a collection of the public types defined in this assembly that are visible outside the assembly.
Gets the display name of the assembly.
Gets a value indicating whether the assembly was loaded from the global assembly cache.
Gets the host context with which the assembly was loaded.
Gets a string representing the version of the common language runtime (CLR) saved in the file containing the manifest.
Gets a value that indicates whether the current assembly was generated dynamically in the current process by using reflection emit.
Gets a value that indicates whether the current assembly is loaded with full trust.
Gets the full path or UNC location of the loaded file that contains the manifest.
Gets the module that contains the manifest for the current assembly.
Gets a collection that contains the modules in this assembly.
Gets the grant set of the current assembly.
Gets a Boolean value indicating whether this assembly was loaded into the reflection-only context.
Gets a value that indicates which set of security rules the common language runtime (CLR) enforces for this assembly.
Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.
Explicitly Implemented Interface Members
Returns the type of the current instance.