AppDomain.Id Property gets an integer that uniquely identifies the application domain within the process.
Imports System
Imports System.Reflection
Public Class Example
<LoaderOptimizationAttribute(LoaderOptimization.MultiDomainHost)> _
Public Shared Sub Main()
ShowDomainInfo()
Dim newDomain As AppDomain = AppDomain.CreateDomain("MyMultiDomain")
newDomain.DoCallBack(AddressOf ShowDomainInfo)
End Sub
Public Shared Sub ShowDomainInfo()
Dim ad As AppDomain = AppDomain.CurrentDomain
Console.WriteLine("FriendlyName: {0}", ad.FriendlyName)
Console.WriteLine("Id: {0}", ad.Id)
Console.WriteLine("IsDefaultAppDomain: {0}", ad.IsDefaultAppDomain())
End Sub
End Class
Related examples in the same category