Class InMemoryAssemblyResolver
Registers and resolves assemblies that may be presented by the core platform, or added with CPEX application.
Inheritance
Namespace: Cireson.Core.Common.Helpers
Assembly: Cireson.Core.Common.dll
Syntax
public static class InMemoryAssemblyResolver : object
Remarks
Admin, 8/24/2017.
Properties
View SourceSubAppDomains
List of created sub domains.
Declaration
public static IEnumerable<System.AppDomain> SubAppDomains { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<System.AppDomain> | The sub application domains. |
Methods
View SourceAssemblyResolve(Object, ResolveEventArgs)
Event handler to resolve missing assemblies from the cached set.
Declaration
public static Assembly AssemblyResolve(object sender, ResolveEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender. |
ResolveEventArgs | args | The |
Returns
Type | Description |
---|---|
Assembly | System.Reflection.Assembly. |
Remarks
Admin, 8/24/2017.
CreateAppDomain(String)
Creates a new AppDomain with the given name, if the name is null, a random name is generated.
Declaration
public static System.AppDomain CreateAppDomain(string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | (Optional) |
Returns
Type | Description |
---|---|
System.AppDomain | The new application domain. |
Remarks
Admin, 8/24/2017.
FindAssemblyDefinition(String)
Returns the closest matching assembly, pass the fullname for the most acurate match, but this is not always possible.
Declaration
public static InMemoryAssemblyDefinition FindAssemblyDefinition(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | . |
Returns
Type | Description |
---|---|
InMemoryAssemblyDefinition | The found assembly definition. |
Remarks
Admin, 8/24/2017.
GetAssemblyName(Byte[])
Gets the assembly name.
Declaration
public static AssemblyName GetAssemblyName(byte[] dllBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dllBuffer | . |
Returns
Type | Description |
---|---|
AssemblyName | The assembly name. |
Remarks
Admin, 8/24/2017.
GetRegisteredAssemblyDefinitions()
Gets the registered assembly definitions in this collection.
Declaration
public static IEnumerable<InMemoryAssemblyDefinition> GetRegisteredAssemblyDefinitions()
Returns
Type | Description |
---|---|
IEnumerable<InMemoryAssemblyDefinition> | An enumerator that allows foreach to be used to process the registered assembly definitions in this collection. |
Remarks
Admin, 8/24/2017.
LoadAssemblyByName(String, System.AppDomain, Boolean)
Loads the assembly into the specified AppDomain, if null, the CurrentDomain is used.
Declaration
public static Assembly LoadAssemblyByName(string key, System.AppDomain appDomain = null, bool forceAppDomainLoad = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Assembly name. |
System.AppDomain | appDomain | (Optional) Domain to load the assembly into. |
System.Boolean | forceAppDomainLoad | (Optional) forces the assembly to be loaded into the app domain, even if a version already exists. |
Returns
Type | Description |
---|---|
Assembly | The assembly by name. |
Remarks
Admin, 8/24/2017.
RegisterAssemblyBinary(Byte[], Byte[])
Registers the binary with the resolver so that if it is requested, the resolver can present the appropriate assembly.
Declaration
public static void RegisterAssemblyBinary(byte[] dllBuffer, byte[] pdbBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dllBuffer | . |
System.Byte[] | pdbBuffer | . |
Remarks
Admin, 8/24/2017.
RegisterAssemblyBinaryWithResult(Byte[], Byte[])
Registers the binary with the resolver so that if it is requested, the resolver can present the appropriate assembly.
Declaration
public static InMemoryAssemblyDefinition RegisterAssemblyBinaryWithResult(byte[] dllBuffer, byte[] pdbBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dllBuffer | . |
System.Byte[] | pdbBuffer | . |
Returns
Type | Description |
---|---|
InMemoryAssemblyDefinition | The registered assembly definition. |
Remarks
Admin, 8/24/2017.
Exceptions
Type | Condition |
---|---|
CpexAssemblyRegistrationException | Thrown when a Cpex Assembly Registration error condition occurs. |
RegisterLocalFileSystemAssembly(String)
Loads the assembly from the file system based on it's simple name if available in the execution path.
Declaration
public static InMemoryAssemblyDefinition RegisterLocalFileSystemAssembly(string assemblyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | assemblyName | . |
Returns
Type | Description |
---|---|
InMemoryAssemblyDefinition | An InMemoryAssemblyDefinition. |
Remarks
Admin, 8/24/2017.
TrackLoadedAssembly(String, String, Version, String)
Track loaded assembly.
Declaration
public static void TrackLoadedAssembly(string name, string fullName, Version version, string location)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | . |
System.String | fullName | Name of the full. |
Version | version | The version. |
System.String | location | The location. |
Remarks
Admin, 8/24/2017.
UnloadAppDomain(System.AppDomain)
Unloads the appdomain.
Declaration
public static void UnloadAppDomain(System.AppDomain appDomain)
Parameters
Type | Name | Description |
---|---|---|
System.AppDomain | appDomain | . |
Remarks
Admin, 8/24/2017.