Compartir a través de


RuntimeEnvironment.FromGlobalAccessCache(Assembly) Método

Definición

Prueba si el ensamblado especificado se carga en la memoria caché global de ensamblados.

public:
 static bool FromGlobalAccessCache(System::Reflection::Assembly ^ a);
public static bool FromGlobalAccessCache (System.Reflection.Assembly a);
static member FromGlobalAccessCache : System.Reflection.Assembly -> bool
Public Shared Function FromGlobalAccessCache (a As Assembly) As Boolean

Parámetros

a
Assembly

Ensamblado que se va a probar.

Devoluciones

Es true si el ensamblado se carga en la memoria caché global de ensamblados; de lo contrario, es false.

Ejemplos

En el ejemplo siguiente se muestra la forma de llamar al método FromGlobalAccessCache. Este ejemplo de código es parte de un ejemplo más grande proporcionado para la clase RuntimeEnvironment.

// Show whether the EXE assembly was loaded from the GAC or from a
// private subdirectory.
Console::WriteLine("Did the {0} assembly load from the GAC? {1}",
    Assembly::GetExecutingAssembly(),
    RuntimeEnvironment::FromGlobalAccessCache(
    Assembly::GetExecutingAssembly()));
// 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));
' Show whether the EXE assembly was loaded from the GAC or from a private subdirectory.
Dim assem As Assembly = GetType(App).Assembly
Console.WriteLine("Did the {0} assembly load from the GAC? {1}", 
                  assem, RuntimeEnvironment.FromGlobalAccessCache(assem))

Se aplica a