ReflectorResolveAssembly(AssemblyName, ResolveAssemblyOptions) Method

Gets the Assembly with the specified assemblyName.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public static Assembly? ResolveAssembly(
	AssemblyName assemblyName,
	ResolveAssemblyOptions options = ResolveAssemblyOptions.TryToLoadAssembly|ResolveAssemblyOptions.AllowPartialMatch
)

Parameters

assemblyName  AssemblyName
Name of the Assembly to retrieve. May contain a fully or partially defined assembly name.
options  ResolveAssemblyOptions  (Optional)
The options for resolving the assembly. This parameter is optional.
Default value: TryToLoadAssembly, AllowPartialMatch.

Return Value

Assembly
An Assembly instance with the loaded assembly, or if the ThrowError flag is not enabled in options and assemblyName could not be resolved with the provided options.

Exceptions

ArgumentNullExceptionassemblyName is .
ArgumentOutOfRangeExceptionoptions has an invalid value.
ReflectionExceptionThrowError is enabled in options and the assembly cannot be resolved or loaded. In case of a load error the InnerException property is set.

See Also