RuntimeEnvironment.FromGlobalAccessCache(Assembly) Methode

Definitie

Test of de opgegeven assembly wordt geladen in de globale assemblycache.

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

Parameters

a
Assembly

De assembly die moet worden getest.

Retouren

true als de assembly in de algemene assemblycache wordt geladen; anders, false.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de FromGlobalAccessCache methode aanroept. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de RuntimeEnvironment klasse.

// 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))

Van toepassing op