Freigeben über


RuntimeEnvironment.FromGlobalAccessCache-Methode

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

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

Syntax

'Declaration
Public Shared Function FromGlobalAccessCache ( _
    a As Assembly _
) As Boolean
'Usage
Dim a As Assembly
Dim returnValue As Boolean

returnValue = RuntimeEnvironment.FromGlobalAccessCache(a)
public static bool FromGlobalAccessCache (
    Assembly a
)
public:
static bool FromGlobalAccessCache (
    Assembly^ a
)
public static boolean FromGlobalAccessCache (
    Assembly a
)
public static function FromGlobalAccessCache (
    a : Assembly
) : boolean

Parameter

  • a
    Die Assembly, für die ermittelt werden soll, ob sie im GAC geladen ist.

Rückgabewert

true, wenn die Assembly im GAC geladen ist, andernfalls false.

Beispiel

Im folgenden Codebeispiel wird das Aufrufen der FromGlobalAccessCache-Methode veranschaulicht. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die 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.
Console::WriteLine("Did the {0} assembly load from the GAC? {1}",
    Assembly::GetExecutingAssembly(),
    RuntimeEnvironment::FromGlobalAccessCache(
    Assembly::GetExecutingAssembly()));

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

RuntimeEnvironment-Klasse
RuntimeEnvironment-Member
System.Runtime.InteropServices-Namespace