SIGN UP MEMBER LOGIN:    
ARTICLE

How to Create Application Domain Using Framework 2.0

Posted by Ashish Singhal Articles | C# Assemblies February 14, 2006
This article will describe members used to create appdomain in runtime.
Reader Level:

This article will describe the members used to create appdomain in runtime.

using System;

namespace AppdomainCreation_Console
{
      class Program
      {
            static void Main(string[] args)
            {

                    //Instantiate AppDomainSetup object
                    AppDomainSetup appDomainSetup = new AppDomainSetup();
                    //Configure AppDomainSetup Setup Information
                   
//Directory where CLR will look during probing to resolve private assemblies.
                   
//By default this is the directory containing the assembly.
                    appDomainSetup.ApplicationBase = @"c:\Test";

                    //Configuration name file used by code loaded into assembly.
                    //By default it is stored in the same folder as the assembly.
                   
//If we set applicationBase the n it should be in same folder.
                    appDomainSetup.ConfigurationFile = "AD.Config";

                    //Semicolon-seprated list of directories that the runtime uses when probing for
                    //private assemblies. these directories are relative to the directory specified
                    //in ApplicationBase.
                    appDomainSetup.PrivateBinPath = "bin;plugins;external";

                    //Remember to save a Reference to the new AppDomain as this Cannot be retrived any other way
                    AppDomain appDomain = AppDomain.CreateDomain("My First Domain", null, appDomainSetup);
                    Console.WriteLine("AppDomain Created, Press ENTER");
                    Console.ReadLine();
            }
     }
}

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Gauge for SharePoint
Become a Sponsor