AssemblyExtensionsTryLoadAllReferences Method

Recursively attempts to load all assemblies referenced from the given assembly.

Definition

Namespace: Gemstone.Reflection.AssemblyExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.110 -- Release Build+3e0464f4461df4d3e1175b13966eb47ff832554d
public static bool TryLoadAllReferences(
	this Assembly instance
)

Parameters

instance  Assembly
The assembly whose references are to be loaded.

Return Value

Boolean
true if the references were successfully loaded; false otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Assembly. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If an object is created from a type that is loaded from an assembly, and if that assembly's references fail to load during instantiation, an exception may be thrown from both the constructor and the finalizer of the object that was instantiated. This method allows us to ensure that all referenced assemblies can be loaded before attempting to instantiate a type from that assembly.

See Also