Freigeben über


RuntimeEnvironment.FromGlobalAccessCache-Methode: (Assembly)

 

Veröffentlicht: Oktober 2016

Testet, ob die angegebene Assembly im globalen Assemblycache geladen wird.

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

Syntax

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

Parameter

Rückgabewert

Type: System.Boolean

true Wenn die Assembly im globalen Assemblycache geladen ist. andernfalls false.

Beispiele

Im folgenden Beispiel 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.
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))
// 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()));

Versionsinformationen

.NET Framework
Verfügbar seit 1.1

Siehe auch

RuntimeEnvironment-Klasse
System.Runtime.InteropServices-Namespace

Zurück zum Anfang