ActivationContext identifies the activation context for the current application. : Activator « Reflection « C# / C Sharp






ActivationContext identifies the activation context for the current application.

 

using System;
using System.Collections;
using System.Text;
using System.Security.Policy;
using System.Reflection;
using System.Security;
using System.Security.Permissions;

public class Program : MarshalByRefObject
{
    [SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy = true)]
    public static void Main(string[] args)
    {
        ActivationContext ac = AppDomain.CurrentDomain.ActivationContext;
        ApplicationIdentity ai = ac.Identity;
        Console.WriteLine("Full name = " + ai.FullName);
        Console.WriteLine("Code base = " + ai.CodeBase);

        Console.Read();
    }
    [SecurityPermission(SecurityAction.LinkDemand, ControlDomainPolicy = true)]
    public void Run()
    {
        Main(new string[] { });
        Console.ReadLine();
    }
}

   
  








Related examples in the same category

1.System.Activator
2.Create types of objects locally or remotely, or obtain references to existing remote objects.
3.Invoke a member with Activator