Show / Hide Table of Contents

Class DynamicMethodsAssembly

Represents the pseudo-assembly that contains a collection of dynamic methods in the external process

Inheritance
System.Object
System.Reflection.Assembly
DynamicMethodsAssembly
Implements
System.Runtime.InteropServices._Assembly
System.Security.IEvidenceFactory
System.Reflection.ICustomAttributeProvider
System.Runtime.Serialization.ISerializable
System.IDisposable
Inherited Members
System.Reflection.Assembly.CreateQualifiedName(System.String, System.String)
System.Reflection.Assembly.GetAssembly(System.Type)
System.Reflection.Assembly.Equals(System.Object)
System.Reflection.Assembly.GetHashCode()
System.Reflection.Assembly.LoadFrom(System.String)
System.Reflection.Assembly.ReflectionOnlyLoadFrom(System.String)
System.Reflection.Assembly.LoadFrom(System.String, System.Security.Policy.Evidence)
System.Reflection.Assembly.LoadFrom(System.String, System.Security.Policy.Evidence, System.Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm)
System.Reflection.Assembly.LoadFrom(System.String, System.Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm)
System.Reflection.Assembly.UnsafeLoadFrom(System.String)
System.Reflection.Assembly.Load(System.String)
System.Reflection.Assembly.ReflectionOnlyLoad(System.String)
System.Reflection.Assembly.Load(System.String, System.Security.Policy.Evidence)
System.Reflection.Assembly.Load(System.Reflection.AssemblyName)
System.Reflection.Assembly.Load(System.Reflection.AssemblyName, System.Security.Policy.Evidence)
System.Reflection.Assembly.LoadWithPartialName(System.String)
System.Reflection.Assembly.LoadWithPartialName(System.String, System.Security.Policy.Evidence)
System.Reflection.Assembly.Load(System.Byte[])
System.Reflection.Assembly.ReflectionOnlyLoad(System.Byte[])
System.Reflection.Assembly.Load(System.Byte[], System.Byte[])
System.Reflection.Assembly.Load(System.Byte[], System.Byte[], System.Security.SecurityContextSource)
System.Reflection.Assembly.Load(System.Byte[], System.Byte[], System.Security.Policy.Evidence)
System.Reflection.Assembly.LoadFile(System.String)
System.Reflection.Assembly.LoadFile(System.String, System.Security.Policy.Evidence)
System.Reflection.Assembly.GetExecutingAssembly()
System.Reflection.Assembly.GetCallingAssembly()
System.Reflection.Assembly.GetEntryAssembly()
System.Reflection.Assembly.GetName(System.Boolean)
System.Reflection.Assembly.System.Runtime.InteropServices._Assembly.GetType()
System.Reflection.Assembly.GetManifestResourceStream(System.Type, System.String)
System.Reflection.Assembly.GetManifestResourceStream(System.String)
System.Reflection.Assembly.GetSatelliteAssembly(System.Globalization.CultureInfo)
System.Reflection.Assembly.GetSatelliteAssembly(System.Globalization.CultureInfo, System.Version)
System.Reflection.Assembly.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
System.Reflection.Assembly.GetCustomAttributes(System.Boolean)
System.Reflection.Assembly.GetCustomAttributes(System.Type, System.Boolean)
System.Reflection.Assembly.IsDefined(System.Type, System.Boolean)
System.Reflection.Assembly.GetCustomAttributesData()
System.Reflection.Assembly.LoadModule(System.String, System.Byte[])
System.Reflection.Assembly.LoadModule(System.String, System.Byte[], System.Byte[])
System.Reflection.Assembly.CreateInstance(System.String)
System.Reflection.Assembly.CreateInstance(System.String, System.Boolean)
System.Reflection.Assembly.CreateInstance(System.String, System.Boolean, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, System.Object[])
System.Reflection.Assembly.GetLoadedModules()
System.Reflection.Assembly.GetLoadedModules(System.Boolean)
System.Reflection.Assembly.GetModules()
System.Reflection.Assembly.GetModules(System.Boolean)
System.Reflection.Assembly.GetModule(System.String)
System.Reflection.Assembly.GetFile(System.String)
System.Reflection.Assembly.GetFiles()
System.Reflection.Assembly.GetFiles(System.Boolean)
System.Reflection.Assembly.GetManifestResourceNames()
System.Reflection.Assembly.GetManifestResourceInfo(System.String)
System.Reflection.Assembly.ToString()
System.Reflection.Assembly.EscapedCodeBase
System.Reflection.Assembly.DefinedTypes
System.Reflection.Assembly.Evidence
System.Reflection.Assembly.PermissionSet
System.Reflection.Assembly.IsFullyTrusted
System.Reflection.Assembly.SecurityRuleSet
System.Reflection.Assembly.CustomAttributes
System.Reflection.Assembly.Modules
System.Reflection.Assembly.ImageRuntimeVersion
System.Reflection.Assembly.GlobalAssemblyCache
System.Reflection.Assembly.HostContext
System.Reflection.Assembly.ModuleResolve
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: CilTools.Runtime
Assembly: CilTools.Runtime.dll
Syntax
public sealed class DynamicMethodsAssembly : Assembly, _Assembly, IEvidenceFactory, ICustomAttributeProvider, ISerializable, IDisposable

Constructors

DynamicMethodsAssembly(DataTarget, ClrAssemblyReader, Boolean)

Creates new DynamicMethodsAssembly object for the specified data target, optionally providing the ClrAssemblyReader instance and indicating whether the created object owns the data target.

Declaration
public DynamicMethodsAssembly(DataTarget dt, ClrAssemblyReader r, bool autoDispose)
Parameters
Type Name Description
Microsoft.Diagnostics.Runtime.DataTarget dt

ClrMD data target to read information from

ClrAssemblyReader r

Assembly reader object to read dependent assemblies.

System.Boolean autoDispose

true if this instance owns tha data target and should dispose it automatically when it is no longer needed

Remarks

If the supplied ClrAssemblyReader is null, the constructor will create new assembly reader instance using the supplied data target.

Exceptions
Type Condition
System.ArgumentNullException

Supplied data target is null

DynamicMethodsAssembly(DataTarget, Boolean)

Creates new DynamicMethodsAssembly object for the specified data target, optionally indicating whether the created object owns the data target.

Declaration
public DynamicMethodsAssembly(DataTarget dt, bool autoDispose)
Parameters
Type Name Description
Microsoft.Diagnostics.Runtime.DataTarget dt

ClrMD data target to read information from

System.Boolean autoDispose

true if this instance owns tha data target and should dispose it automatically when it is no longer needed

Exceptions
Type Condition
System.ArgumentNullException

Supplied data target is null

Properties

AssemblyReader

Gets the assembly reader object used to read dependent assemblies

Declaration
public ClrAssemblyReader AssemblyReader { get; }
Property Value
Type Description
ClrAssemblyReader
Remarks

When dynamic method references a member from the external assembly, the library will use this assembly reader object when resolving metadata tokens from the external assembly. The assembly reader acts as cache that stores assembly instance so we don't need to load them multiple times.

ChildType

Gets pseudo-type that contains the collection of dynamic methods

Declaration
public Type ChildType { get; }
Property Value
Type Description
System.Type

CodeBase

Gets the full path to the assembly. This implementation always returns an empty string.

Declaration
public override string CodeBase { get; }
Property Value
Type Description
System.String
Overrides
System.Reflection.Assembly.CodeBase

EntryPoint

Gets an entry point method for this assembly

Declaration
public override MethodInfo EntryPoint { get; }
Property Value
Type Description
System.Reflection.MethodInfo

This implementation always returns null

Overrides
System.Reflection.Assembly.EntryPoint

ExportedTypes

Gets a collection of the public types defined in this assembly that are visible outside the assembly.

Declaration
public override IEnumerable<Type> ExportedTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>
Overrides
System.Reflection.Assembly.ExportedTypes
Remarks

This implementation returns an empty collection

FullName

Gets the display name of the assembly

Declaration
public override string FullName { get; }
Property Value
Type Description
System.String
Overrides
System.Reflection.Assembly.FullName

IsDynamic

Gets a value that indicates whether the current assembly was generated dynamically at runtime.

Declaration
public override bool IsDynamic { get; }
Property Value
Type Description
System.Boolean
Overrides
System.Reflection.Assembly.IsDynamic
Remarks

This implementation always returns true

Location

Gets the full path to the assembly. This implementation always returns an empty string.

Declaration
public override string Location { get; }
Property Value
Type Description
System.String
Overrides
System.Reflection.Assembly.Location

ManifestModule

Gets a module that contains the assembly manifest

Declaration
public override Module ManifestModule { get; }
Property Value
Type Description
System.Reflection.Module

This implementation always returns null

Overrides
System.Reflection.Assembly.ManifestModule

ReflectionOnly

Gets a boolean value indicating whether this assembly was loaded into the reflection-only context.

Declaration
public override bool ReflectionOnly { get; }
Property Value
Type Description
System.Boolean

This implementation always returns true

Overrides
System.Reflection.Assembly.ReflectionOnly

Target

ClrMD data target associated with this instance

Declaration
public DataTarget Target { get; }
Property Value
Type Description
Microsoft.Diagnostics.Runtime.DataTarget

Methods

Dispose()

Releases unmagnaged resources associated with this assembly object

Declaration
public void Dispose()
Remarks

This method only disposes the underlying data target if this instance was constructed with the autoDispose parameter set to true.

EnumerateMethods()

Gets the collection of all methods defined in this assembly

Declaration
public IEnumerable<MethodBase> EnumerateMethods()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.MethodBase>

GetExportedTypes()

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

Declaration
public override Type[] GetExportedTypes()
Returns
Type Description
System.Type[]

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

Overrides
System.Reflection.Assembly.GetExportedTypes()
Remarks

This implementation returns an empty array

GetName()

Gets an AssemblyName for this assembly

Declaration
public override AssemblyName GetName()
Returns
Type Description
System.Reflection.AssemblyName

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

Overrides
System.Reflection.Assembly.GetName()

GetReferencedAssemblies()

Gets an array of assembly names for assemblies referenced by this assembly

Declaration
public override AssemblyName[] GetReferencedAssemblies()
Returns
Type Description
System.Reflection.AssemblyName[]

This implementation always returns an empty array

Overrides
System.Reflection.Assembly.GetReferencedAssemblies()

GetType(String)

Gets the Type object that represents the specified type.

Declaration
public override Type GetType(string name)
Parameters
Type Name Description
System.String name

The full name of the type.

Returns
Type Description
System.Type

An object that represents the specified type, or null if the type is not found.

Overrides
System.Reflection.Assembly.GetType(System.String)

GetType(String, Boolean)

Gets the Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found.

Declaration
public override Type GetType(string name, bool throwOnError)
Parameters
Type Name Description
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.

Returns
Type Description
System.Type

An object that represents the specified type.

Overrides
System.Reflection.Assembly.GetType(System.String, System.Boolean)

GetType(String, Boolean, Boolean)

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

Declaration
public override Type GetType(string name, bool throwOnError, bool ignoreCase)
Parameters
Type Name Description
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 type.

Overrides
System.Reflection.Assembly.GetType(System.String, System.Boolean, System.Boolean)

GetTypes()

Gets the types defined in this assembly.

Declaration
public override Type[] GetTypes()
Returns
Type Description
System.Type[]

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

Overrides
System.Reflection.Assembly.GetTypes()
Remarks

This implementation returns collection that consists of the single pseudo-type representing dynamic methods

Implements

System.Runtime.InteropServices._Assembly
System.Security.IEvidenceFactory
System.Reflection.ICustomAttributeProvider
System.Runtime.Serialization.ISerializable
System.IDisposable

Extension Methods

CilExtensions.GetReferencedMethods(Assembly)
CilExtensions.GetReferencedMembers(Assembly)
CilExtensions.GetReferencedMembers(Assembly, MemberCriteria)
Back to top CIL Tools (published from sources in GitHub repository).
Generated by DocFX