Share via


JsonRpc.LoadType(String, String) Method

Definition

Attempts to load a type based on its full name and possibly assembly name.

protected internal virtual Type? LoadType (string typeFullName, string? assemblyName);
abstract member LoadType : string * string -> Type
override this.LoadType : string * string -> Type
Protected Friend Overridable Function LoadType (typeFullName As String, assemblyName As String) As Type

Parameters

typeFullName
String

The FullName of the type to be loaded.

assemblyName
String

The assemble name that is expected to define the type, if available. This should be parseable by AssemblyName(String).

Returns

The loaded Type, if one could be found; otherwise null.

Remarks

This method is used to load types that are strongly referenced by incoming messages during serialization. It is important to not load types that may pose a security threat based on the type and the trust level of the remote party.

The default implementation of this method loads any type named if it can be found based on its assembly name (if provided) or based on any assembly already loaded in the AppDomain otherwise.

Implementations should avoid throwing FileLoadException, TypeLoadException or other exceptions, preferring to return null instead.

Applies to