You are loading a new assembly into an application. You need to override the default evidence for the assembly. You require the common language runtime (CLR) to grant the assembly a permission set, as if the assembly were loaded from the local intranet zone. You need to build the evidence collection. Which code segment should you use?

You are loading a new assembly into an application. You need to override the default evidence
for the assembly. You require the common language runtime (CLR) to grant the assembly a
permission set, as if the assembly were loaded from the local intranet zone.
You need to build the evidence collection. Which code segment should you use?


 A. Evidence evidence = new Evidence(
    Assembly.GetExecutingAssembly().Evidence
    );
B. Evidence evidence = new Evidence();evidence.AddAssembly(new 
    Zone(SecurityZone.Intranet));
C. Evidence evidence = new Evidence();evidence.AddHost(new Zone(SecurityZone.Intranet));
D. Evidence evidence = new Evidence(
    AppDomain.CurrentDomain.Evidence );

Answer: C

No comments:

Post a Comment