AssemblyResolver Class

Helper class for resolving assemblies based on file names.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public class AssemblyResolver
Inheritance
Object    AssemblyResolver

Constructors

AssemblyResolverInitializes a new instance of the AssemblyResolver class

Properties

AssemblyVersionString Build a DHI assembly version string, on the form "Version=10.0.0.0, Culture=neutral, PublicKeyToken=c513450b5d0bf0bf" The string will automatically be updated with new version numbers whenever the MIKE version number is incremented.

Methods

AddAssembly Add assembly to list of assemblies, loading by full name or full path

If assembly is not loaded, an exception is thrown.

AddAssemblyFile Add assembly from file name, given either a full path or assuming it is located in the BinFolder or if BinFolder is not set, the local folder.
CreateAssemblyLongName Create a fully qualified assembly name (long name) from its short name. The fully qualified name will automatically be updated with new version numbers whenever the MIKE version number is incremented.

For example if inputting "DHI.Mike1D.Generic", the outcome will be "DHI.Mike1D.Generic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=c513450b5d0bf0bf" which can be used directly in the Load(String) method.

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
LoadAssembly Static method to load assembly based on its fully qualified name, or from a file path.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ResolveAssembly Resolve assembly

To bind to AppDomain.CurrentDomain.AssemblyResolve event.

SetBaseAssembly Sets BinFolder to directory of assembly location
SetupLocalFolderResolution Set up local folder resolution, i.e. if the assembly exist in the same folder as this assembly, try use that, regardless of its version number.

This method can be called multiple times, any second calls just have no effect.

ToStringReturns a string that represents the current object.
(Inherited from Object)

Fields

Assemblies Known assemblies.
BinFolder Bin folder of where to look for assemblies.

See Also