HostSecurityManager.GenerateAppDomainEvidence Method (Type)
Requests a specific evidence type for the application domain.
Assembly: mscorlib (in mscorlib.dll)
This method can be overridden by a derived class. The base implementation returns null.
The common language runtime calls this method when evidence of the specified type is needed for the current AppDomain. The returned value is used as host-supplied evidence, and is stored in the Evidence collection of the CurrentDomain property. You can use the Evidence.GetAssemblyEvidence<T> method to obtain the generated evidence from the collection.
This method of generating evidence allows hosts to delay evidence generation for an AppDomain until the evidence is needed. In the .NET Framework version 3.5 and earlier versions, it was necessary to provide AppDomain evidence at load time by overriding the ProvideAppDomainEvidence method. We recommend that you use to provide evidence instead of overriding ProvideAppDomainEvidence.
The GetHostSuppliedAppDomainEvidenceTypes method.method is called back into only for types of evidence that the host has specified in the override of the
A return value of null indicates that the host cannot generate evidence of this specific type.
The following example shows how to override the ProvideAppDomainEvidence method for a custom host security manager. This example is part of a larger example provided for the HostSecurityManager class.
Available since 4.0