Freigeben über


RuntimeEnvironment.FromGlobalAccessCache(Assembly) Methode

Definition

Überprüft, ob die angegebene Assembly im globalen Assemblycache geladen ist.

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

Parameter

a
Assembly

Die zu überprüfende Assembly.

Gibt zurück

true, wenn die Assembly im globalen Assemblycache geladen wurde, andernfalls false.

Beispiele

Im folgenden Beispiel wird das Aufrufen der FromGlobalAccessCache-Methode veranschaulicht. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die RuntimeEnvironment-Klasse bereitgestellt wird.

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

Gilt für: