Show / Hide Table of Contents

Interface IAssemblyIntrospectionProvider

Interface representing a reflection provider used to introspect System.Reflection.Assembly objects.

Namespace: System.Reflection
Assembly: Nuqleon.Reflection.Virtualization.dll
Syntax
public interface IAssemblyIntrospectionProvider

Methods

AddModuleResolve(Assembly, ModuleResolveEventHandler)

Adds a module resolve handler.

Declaration
void AddModuleResolve(Assembly assembly, ModuleResolveEventHandler handler)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to add a module resolve handler for.

System.Reflection.ModuleResolveEventHandler handler

The module resolve handler to add.

Remarks

Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.

GetCustomAttributes(Assembly, Boolean)

Gets all the custom attributes for the specified assembly.

Declaration
IReadOnlyList<object> GetCustomAttributes(Assembly assembly, bool inherit)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get custom attributes for.

System.Boolean inherit

This argument is ignored for objects of type System.Reflection.Assembly.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Object>

An array that contains the custom attributes for the specified assembly.

GetCustomAttributes(Assembly, Type, Boolean)

Gets the custom attributes for the specified assembly as specified by type.

Declaration
IReadOnlyList<object> GetCustomAttributes(Assembly assembly, Type attributeType, bool inherit)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get custom attributes for.

System.Type attributeType

The type for which the custom attributes are to be returned.

System.Boolean inherit

This argument is ignored for objects of type System.Reflection.Assembly.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Object>

An array that contains the custom attributes for the specified assembly as specified by attributeType.

GetCustomAttributesData(Assembly)

Returns information about the attributes that have been applied to the specified assembly, expressed as System.Reflection.CustomAttributeData objects.

Declaration
IEnumerable<CustomAttributeData> GetCustomAttributesData(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get custom attributes data for.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData>

A generic list of System.Reflection.CustomAttributeData objects representing data about the attributes that have been applied to the specified assembly.

GetDefinedTypes(Assembly)

Gets the types defined in the specified assembly.

Declaration
IEnumerable<TypeInfo> GetDefinedTypes(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to search in.

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo>

An array of types defined in the specified assembly.

GetEntryPoint(Assembly)

Gets the entry point of this assembly.

Declaration
MethodInfo GetEntryPoint(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the entry point for.

Returns
Type Description
System.Reflection.MethodInfo

An object that represents the entry point of this assembly. If no entry point is found (for example, the assembly is a DLL), null is returned.

GetExportedTypes(Assembly)

Gets the public types defined in the specified assembly that are visible outside the specified assembly.

Declaration
IReadOnlyList<Type> GetExportedTypes(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get exported types from.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Type>

An array that represents the types defined in this assembly that are visible outside the assembly.

GetFile(Assembly, String)

Gets a System.IO.FileStream for the specified file in the file table of the manifest of the specified assembly.

Declaration
FileStream GetFile(Assembly assembly, string name)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the file from.

System.String name

The name of the specified file. Do not include the path to the file.

Returns
Type Description
System.IO.FileStream

A stream that contains the specified file, or null if the file is not found.

GetFiles(Assembly, Boolean)

Gets the files in the file table of an assembly manifest, specifying whether to include resource modules.

Declaration
IReadOnlyList<FileStream> GetFiles(Assembly assembly, bool getResourceModules)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the files from.

System.Boolean getResourceModules

true to include resource modules; otherwise, false.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.IO.FileStream>

An array of streams that contain the files.

GetFullName(Assembly)

Gets the display name of the assembly.

Declaration
string GetFullName(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the display name for.

Returns
Type Description
System.String

The display name of the assembly.

GetHostContext(Assembly)

Gets the host context with which the assembly was loaded.

Declaration
long GetHostContext(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the host context for.

Returns
Type Description
System.Int64

An System.Int64 value that indicates the host context with which the assembly was loaded, if any.

GetImageRuntimeVersion(Assembly)

Gets a string representing the version of the common language runtime (CLR) saved in the file containing the manifest.

Declaration
string GetImageRuntimeVersion(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the runtime version for.

Returns
Type Description
System.String

The CLR version folder name. This is not a full path.

GetLoadedModules(Assembly, Boolean)

Gets all the loaded modules that are part of the specified assembly, specifying whether to include resource modules.

Declaration
IReadOnlyList<Module> GetLoadedModules(Assembly assembly, bool getResourceModules)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the loaded modules for.

System.Boolean getResourceModules

true to include resource modules; otherwise, false.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Reflection.Module>

An array of modules.

GetLocation(Assembly)

Gets the path or UNC location of the loaded file that contains the manifest.

Declaration
string GetLocation(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the location for.

Returns
Type Description
System.String

The location of the loaded file that contains the manifest. If the loaded file was shadow-copied, the location is that of the file after being shadow-copied. If the assembly is loaded from a byte array, such as when using the System.Reflection.Assembly.Load(System.Byte[]) method overload, the value returned is an empty string ("").

GetManifestModule(Assembly)

Gets the module that contains the manifest for the current assembly.

Declaration
Module GetManifestModule(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the manifest module for.

Returns
Type Description
System.Reflection.Module

The module that contains the manifest for the assembly.

GetManifestResourceInfo(Assembly, String)

Returns information about how the given resource has been persisted.

Declaration
ManifestResourceInfo GetManifestResourceInfo(Assembly assembly, string resourceName)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the manifest resource info from.

System.String resourceName

The case-sensitive name of the resource.

Returns
Type Description
System.Reflection.ManifestResourceInfo

An object that is populated with information about the resource's topology, or null if the resource is not found.

GetManifestResourceNames(Assembly)

Returns the names of all the resources in the specified assembly.

Declaration
IReadOnlyList<string> GetManifestResourceNames(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the manifest resource names from.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.String>

An array that contains the names of all the resources.

GetManifestResourceStream(Assembly, String)

Loads the specified manifest resource from the specified assembly.

Declaration
Stream GetManifestResourceStream(Assembly assembly, string name)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the manifest resource stream from.

System.String name

The case-sensitive name of the manifest resource being requested.

Returns
Type Description
System.IO.Stream

The manifest resource; or null if no resources were specified during compilation or if the resource is not visible to the caller.

GetManifestResourceStream(Assembly, Type, String)

Loads the specified manifest resource, scoped by the namespace of the specified type, from the specified assembly.

Declaration
Stream GetManifestResourceStream(Assembly assembly, Type type, string name)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the manifest resource stream from.

System.Type type

The type whose namespace is used to scope the manifest resource name.

System.String name

The case-sensitive name of the manifest resource being requested.

Returns
Type Description
System.IO.Stream

The manifest resource; or null if no resources were specified during compilation or if the resource is not visible to the caller.

GetModule(Assembly, String)

Gets the specified module in the specified assembly.

Declaration
Module GetModule(Assembly assembly, string name)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the module from.

System.String name

The name of the module being requested.

Returns
Type Description
System.Reflection.Module

The module being requested, or null if the module is not found.

GetModules(Assembly, Boolean)

Gets all the modules that are part of the specified assembly, specifying whether to include resource modules.

Declaration
IReadOnlyList<Module> GetModules(Assembly assembly, bool getResourceModules)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the modules for.

System.Boolean getResourceModules

true to include resource modules; otherwise, false.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Reflection.Module>

An array of modules.

GetName(Assembly, Boolean)

Gets an System.Reflection.AssemblyName for the specified assembly, setting the codebase as specified by copiedName.

Declaration
AssemblyName GetName(Assembly assembly, bool copiedName)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the name for.

System.Boolean copiedName

true to set the System.Reflection.Assembly.CodeBase to the location of the assembly after it was shadow copied; false to set System.Reflection.Assembly.CodeBase to the original location.

Returns
Type Description
System.Reflection.AssemblyName

An object that contains the fully parsed display name for this assembly.

GetReferencedAssemblies(Assembly)

Gets the System.Reflection.AssemblyName objects for all the assemblies referenced by the specified assembly.

Declaration
IReadOnlyList<AssemblyName> GetReferencedAssemblies(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the referenced assemblies for.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Reflection.AssemblyName>

An array that contains the fully parsed display names of all the assemblies referenced by the specified assembly.

GetReflectionOnly(Assembly)

Gets a System.Boolean value indicating whether specified assembly was loaded into the reflection-only context.

Declaration
bool GetReflectionOnly(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to check.

Returns
Type Description
System.Boolean

true if the assembly was loaded into the reflection-only context, rather than the execution context; otherwise, false.

GetSatelliteAssembly(Assembly, CultureInfo)

Gets the satellite assembly for the specified culture.

Declaration
Assembly GetSatelliteAssembly(Assembly assembly, CultureInfo culture)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the satellite assembly from.

System.Globalization.CultureInfo culture

The specified culture.

Returns
Type Description
System.Reflection.Assembly

The specified satellite assembly.

GetSatelliteAssembly(Assembly, CultureInfo, Version)

Gets the specified version of the satellite assembly for the specified culture.

Declaration
Assembly GetSatelliteAssembly(Assembly assembly, CultureInfo culture, Version version)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the satellite assembly from.

System.Globalization.CultureInfo culture

The specified culture.

System.Version version

The version of the satellite assembly.

Returns
Type Description
System.Reflection.Assembly

The specified satellite assembly.

GetSecurityRuleSet(Assembly)

Gets a value that indicates which set of security rules the common language runtime (CLR) enforces for this assembly.

Declaration
SecurityRuleSet GetSecurityRuleSet(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to get the security rules for.

Returns
Type Description
System.Security.SecurityRuleSet

The security rule set that the CLR enforces for this assembly.

GetType(Assembly, String, Boolean, Boolean)

Gets the System.Type object with the specified name in the specified assembly, with the options of ignoring the case, and of throwing an exception if the type is not found.

Declaration
Type GetType(Assembly assembly, string name, bool throwOnError, bool ignoreCase)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to retrieve the type from.

System.String name

The full name of the type.

System.Boolean throwOnError

true to throw an exception if the type is not found; false to return null.

System.Boolean ignoreCase

true to ignore the case of the type name; otherwise, false.

Returns
Type Description
System.Type

An object that represents the specified class.

GetTypes(Assembly)

Gets the types defined in the specified assembly.

Declaration
IReadOnlyList<Type> GetTypes(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to retrieve the types from.

Returns
Type Description
System.Collections.Generic.IReadOnlyList<System.Type>

An array that contains all the types that are defined in this assembly.

IsDefined(Assembly, Type, Boolean)

Determines whether the custom attribute of the specified attributeType type or its derived types is applied to the specified assembly.

Declaration
bool IsDefined(Assembly assembly, Type attributeType, bool inherit)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to check the custom attribute on.

System.Type attributeType

The type of attribute to search for.

System.Boolean inherit

This argument is ignored for objects of this type.

Returns
Type Description
System.Boolean

true if one or more instances of attributeType or its derived types are applied to the specified assembly; otherwise, false.

IsDynamic(Assembly)

Gets a value that indicates whether the current assembly was generated dynamically in the current process by using reflection emit.

Declaration
bool IsDynamic(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to check.

Returns
Type Description
System.Boolean

true if the current assembly was generated dynamically in the current process; otherwise, false.

IsFullyTrusted(Assembly)

Gets a value that indicates whether the current assembly is loaded with full trust.

Declaration
bool IsFullyTrusted(Assembly assembly)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to check.

Returns
Type Description
System.Boolean

true if the current assembly is loaded with full trust; otherwise, false.

RemoveModuleResolve(Assembly, ModuleResolveEventHandler)

Removes a module resolve handler.

Declaration
void RemoveModuleResolve(Assembly assembly, ModuleResolveEventHandler handler)
Parameters
Type Name Description
System.Reflection.Assembly assembly

The assembly to remove a module resolve handler for.

System.Reflection.ModuleResolveEventHandler handler

The module resolve handler to remove.

Remarks

Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means.

Extension Methods

AssemblyIntrospectionProviderExtensions.GetFiles(IAssemblyIntrospectionProvider, Assembly)
AssemblyIntrospectionProviderExtensions.GetLoadedModules(IAssemblyIntrospectionProvider, Assembly)
AssemblyIntrospectionProviderExtensions.GetModules(IAssemblyIntrospectionProvider, Assembly)
AssemblyIntrospectionProviderExtensions.GetName(IAssemblyIntrospectionProvider, Assembly)
AssemblyIntrospectionProviderExtensions.GetType(IAssemblyIntrospectionProvider, Assembly, String)
AssemblyIntrospectionProviderExtensions.GetType(IAssemblyIntrospectionProvider, Assembly, String, Boolean)
CustomAttributeProviderExtensions.IsDefined(IAssemblyIntrospectionProvider, Assembly, Type)
CustomAttributeProviderExtensions.GetCustomAttributes(IAssemblyIntrospectionProvider, Assembly)
CustomAttributeProviderExtensions.GetCustomAttributes(IAssemblyIntrospectionProvider, Assembly, Type)
CustomAttributeProviderExtensions.GetCustomAttributes<T>(IAssemblyIntrospectionProvider, Assembly)
CustomAttributeProviderExtensions.GetCustomAttribute(IAssemblyIntrospectionProvider, Assembly, Type)
CustomAttributeProviderExtensions.GetCustomAttribute<T>(IAssemblyIntrospectionProvider, Assembly)
In This Article
Back to top Generated by DocFX