Partager via


RuntimeEnvironment.FromGlobalAccessCache(Assembly) Méthode

Définition

Teste si l’assembly spécifié est chargé dans le Global Assembly Cache.

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

Paramètres

a
Assembly

Assembly à tester.

Retours

true si l’assembly est chargé dans le Global Assembly Cache ; sinon, false.

Exemples

L'exemple suivant montre l'appel à la méthode FromGlobalAccessCache. Cet exemple de code fait partie d’un exemple plus grand fourni pour la RuntimeEnvironment classe .

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

S’applique à