RuntimeEnvironment.FromGlobalAccessCache Method (Assembly)


Tests whether the specified assembly is loaded in the global assembly cache.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

public static bool FromGlobalAccessCache(
	Assembly a


Type: System.Reflection.Assembly

The assembly to test.

Return Value

Type: System.Boolean

true if the assembly is loaded in the global assembly cache; otherwise, false.

The following example demonstrates calling the FromGlobalAccessCache method. This code example is part of a larger example provided for the RuntimeEnvironment class.

// Show whether the EXE assembly was loaded from the GAC or from a private subdirectory.
Assembly assem = typeof(App).Assembly;
Console.WriteLine("Did the {0} assembly load from the GAC? {1}",
   assem, RuntimeEnvironment.FromGlobalAccessCache(assem));

.NET Framework
Available since 1.1
Return to top