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 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.
Imports System Imports System.Security.Policy Imports System.Security Imports System.Security.Permissions Imports Microsoft.VisualBasic Class GacDemo <STAThread()> _ Overloads Shared Sub Main(ByVal args() As String) Dim myGacInstalled As New GacInstalled Dim hostEvidence() As Object = {myGacInstalled} Dim assemblyEvidence() As Object Dim myEvidence As New Evidence(hostEvidence, assemblyEvidence) Dim myPerm As GacIdentityPermission = _ CType(myGacInstalled.CreateIdentityPermission(myEvidence), _ GacIdentityPermission) Console.WriteLine(myPerm.ToXml().ToString()) Dim myGacInstalledCopy As GacInstalled = _ CType(myGacInstalled.Copy(), GacInstalled) Dim result As Boolean = myGacInstalled.Equals(myGacInstalledCopy) Console.WriteLine( _ ("Hashcode = " & myGacInstalled.GetHashCode().ToString())) Console.WriteLine(myGacInstalled.ToString()) End Sub 'Main End Class 'GacDemo
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.