Application Domains in VB.NET

In this article I will explain you about Application Domains in VB.NET
  • 2683

Basically the concept is that you can create an area in memory for your application. In .NET, each application runs in an application domain under the control of a host. The host creates the application domain and loads assemblies into it. The host has access to information about the code via evidence. This information can include the zone in which the code originates or the digital signatures of the assemblies in the application domain. It is managed and kept from being directly accessed by any other program within its own virtual area.

You can reference your own domain or create a sub domain that is safe. The idea is that you can run more than one program within your program and it will be safe and efficient

Example 1.1 shows you how to create a application domain.

Example 1.1

    Class Domain1
        Public Shared Sub Main()
            Console.WriteLine("New Appication Domain.")
            Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain")
            Console.WriteLine(("Host domain: " + AppDomain.CurrentDomain.FriendlyName))
            Console.WriteLine(("child domain: " + domain.FriendlyName))
        End Sub
    End
Class

Conclusion

Hope this article would have helped you in understanding Application Domains in VB.NET

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.