ReflectorResolveType(Assembly, String, ResolveTypeOptions) Method

Gets the Type with the specified typeName from the specified assembly. As the type is about to be resolved from the specified assembly, assembly names are allowed to be specified in the generic arguments only.
See the Examples section of the ResolveType(String, ResolveTypeOptions) overload for some examples.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public static Type? ResolveType(
	Assembly assembly,
	string typeName,
	ResolveTypeOptions options = ResolveTypeOptions.TryToLoadAssemblies|ResolveTypeOptions.AllowPartialAssemblyMatch
)

Parameters

assembly  Assembly
The assembly that contains the type to retrieve.
typeName  String
The type name as a string representation.
options  ResolveTypeOptions  (Optional)
The options for resolving the type. This parameter is optional.
Default value: TryToLoadAssemblies, AllowPartialAssemblyMatch.

Return Value

Type
The resolved Type, or if the ThrowError flag is not enabled in options and typeName could not be resolved with the provided options.

Remarks

typeName can be generic and may contain fully or partially defined assembly names.

typeName can contain generic parameter types in the format as they are returned by the TypeExtensions.GetName extension method.

If the AllowIgnoreAssemblyName flag is enabled in options, then typeName can be resolved not just from the provided assembly but from any loaded assemblies.

See Also