Get name of current AppDomain and context ID : Context « Development « C# / CSharp Tutorial






using System;
using System.Threading;

class MainClass
{
  // [MTAThread]
  [STAThread]
  static void Main(string[] args)
  {
    Thread primaryThread = Thread.CurrentThread;

    primaryThread.Name = "ThePrimaryThread";

    Console.WriteLine("Name of current AppDomain: {0}", Thread.GetDomain().FriendlyName);
    Console.WriteLine("ID of current Context: {0}", Thread.CurrentContext.ContextID);
  }
}
Name of current AppDomain: main.exe
ID of current Context: 0








14.22.Context
14.22.1.Contextual info
14.22.2.Contextual information: ContextBoundObject
14.22.3.Get name of current AppDomain and context ID