How to create an application domain?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

How to create an application domain?

Rating:

The steps to create an application domain are as follows:

  1. Create a new C# project in Visual Studio .NET 2005, and select the Console Application type project. Click the OK button.

  2. On the code window, type the following code:

    using System;
    using System.Reflection;


    This code snippet uses the System and System.Reflection namespaces, which indicate that all the classes and their methods, properties, and interfaces can be implemented in the application code.

  3. To create a new application domain, type the following code:

    class MyAppDomain
    {
       public static void Main()
       {
           Console.WriteLine("To create a new application domain:");
           AppDomain domain = AppDomain.CreateDomain("NewAppDomain");
           Console.WriteLine("Host Application Domain is: " +
             AppDomain.CurrentDomain.FriendlyName);
       }
    }


    This code snippet creates a user-defined class named MyAppDomain. Within the Main method block, call the AppDomain.CreateDomain method that creates a new application domain named NewAppDomain.

    The AppDomain.CurrentDomain.FriendlyName property is set in order to retrieve the host application domain for the current thread. The FriendlyName property of the AppDomain class is set to retrieve the friendly name of the application domain.

    The friendly name of the application domain is the name of the assembly file that is used to run within the current application domain. If the name of an assembly file name is Assembly1.exe, the friendly name of the application domain will also be Assembly1.exe.


Rating:



Other articles

Click here to Article home

Microsoft Certification MCSE: MCSA , MCTS, MCDST, MCAD, MCDBA, MCSE Messaging, MCSE Security
JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.
 
HACKER SAFE certified sites prevent over 99.9% of hacker crime.