AppDomain.CurrentDomain gets the current application domain for the current Thread.
Imports System
Imports System.Reflection
Imports System.Security.Policy
Class ADSetupInformation
Public Shared Sub Main()
Dim domaininfo As New AppDomainSetup()
domaininfo.ApplicationBase = System.Environment.CurrentDirectory
Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo)
Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName)
Console.WriteLine("new child domain: " + domain.FriendlyName)
Console.WriteLine("Application base is: " + domain.SetupInformation.ApplicationBase)
AppDomain.Unload(domain)
End Sub
End Class
Related examples in the same category