Click or drag to resize

ApplicationContext Class

Manages all assemblies loaded into an AppDomain.
Inheritance Hierarchy
SystemObject
  Nova.CodeDOMApplicationContext

Namespace:  Nova.CodeDOM
Assembly:  Nova.CodeDOM (in Nova.CodeDOM.dll) Version: 7.44.8391.13415
Syntax
C#
public class ApplicationContext

The ApplicationContext type exposes the following members.

Constructors
  NameDescription
Public methodApplicationContext
Create an ApplicationContext.
Top
Properties
  NameDescription
Public propertyAppDomain
The .NET AppDomain object associated with this ApplicationContext instance.
Public propertyID
The unique ID of the underlying AppDomain object.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberExpandEnvironmentMacros
Expand all "$(name)" macros in the specified string by replacing with matching environment variables.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindLoadedAssembly
Find any already-loaded assembly with the specified name.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetMasterInstance
Get the master ApplicationContext object.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodStatic memberLoad
Public methodLoadAssembly
Load an assembly into the current AppDomain.
Protected methodStatic memberLoadFrom
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnload
Unload the ApplicationContext (unloads all loaded assemblies if not using reflection).
Top
Fields
  NameDescription
Protected field_appDomain
The .NET AppDomain object associated with this ApplicationContext instance.
Protected field_assemblyToProjectMap
Map of assemblies to projects in which they are referenced (used only when loading with reflection).
Protected field_loadedAssembliesByAssembly
Loaded assemblies indexed by assembly (used only when loading with reflection, to handle already-loaded assemblies).
Protected field_loadedAssembliesByName
Loaded assemblies indexed by display name, and also short name for the latest version.
Public fieldStatic memberUseMonoCecilLoads
Use Mono Cecil to load assemblies instead of reflection. Loaded data will use types in the Mono.Cecil namespace such as AssemblyDefinition, TypeDefinition, MethodDefinition, PropertyDefinition, FieldDefinition, etc. instead of the reflection types of Assembly, Type, MethodInfo, PropertyInfo, FieldInfo, etc. Using Mono Cecil is faster than reflection, and gets around various possible issues, including the inability to unload reflection data from memory.
Public fieldStatic memberUseReflectionOnlyLoads
Use reflection-only loads to load assemblies (ignored if using Mono Cecil loads). Reflection-only loads bypass strong name verifications, CAS policy checks, processor architecture loading rules, binding policies, don't execute any init code, and prevent automatic probing of dependencies. This can help to load assemblies that otherwise wouldn't be loadable, but it can also cause loading problems of its own, such as trying to load old framework assemblies (due to bypassing binding policies) that aren't compatible with newer and/or 64bit OSes, or illegal cross-references with normally-loaded assemblies. However, logic has been added to workaround these issues in most cases, and NOT using reflection-only loads prevents loading old versions of framework assemblies, which can cause resolve conflicts (in either case, old versions of 'mscorlib' can never be loaded into the default app domain).
Top
Remarks
When using reflection-only or Mono Cecil loads, different versions of the same assembly can be loaded into the same AppDomain, otherwise separate AppDomains must be used (which is not yet supported, and might never be since Mono Cecil might be the new preferred way of handling this).
See Also