GacInstalled Class
Confirms that a code assembly originates in the global assembly cache (GAC) as evidence for policy evaluation. This class cannot be inherited.
Assembly: mscorlib (in mscorlib.dll)
The GacInstalled type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Clone | Creates a new object that is a copy of the current instance. (Overrides EvidenceBase::Clone().) |
![]() | Copy | Creates an equivalent copy of the current object. |
![]() | CreateIdentityPermission | Creates a new identity permission that corresponds to the current object. |
![]() | Equals | Indicates whether the current object is equivalent to the specified object. (Overrides Object::Equals(Object).) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Returns a hash code for the current object. (Overrides Object::GetHashCode().) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string representation of the current object. (Overrides Object::ToString().) |
The presence of GacInstalled evidence produces a GacIdentityPermission in the grant set. If there is a Demand for GacIdentityPermission, the GacIdentityPermission that corresponds to the GacInstalled evidence is compared with the demanded permission.
The following code example shows the use of the GacInstalled class.
using namespace System; using namespace System::Security::Policy; using namespace System::Security; using namespace System::Security::Permissions; [STAThread] int main() { GacInstalled ^ myGacInstalled = gcnew GacInstalled; array<Object^>^hostEvidence = {myGacInstalled}; array<Object^>^assemblyEvidence = {}; Evidence^ myEvidence = gcnew Evidence( hostEvidence,assemblyEvidence ); GacIdentityPermission ^ myPerm = dynamic_cast<GacIdentityPermission^> (myGacInstalled->CreateIdentityPermission( myEvidence )); Console::WriteLine( myPerm->ToXml() ); GacInstalled ^ myGacInstalledCopy = dynamic_cast<GacInstalled^>(myGacInstalled->Copy()); bool result = myGacInstalled->Equals( myGacInstalledCopy ); Console::WriteLine( "Hashcode = {0}", myGacInstalled->GetHashCode() ); Console::WriteLine( myGacInstalled->ToString() ); }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
