Csharp/C Sharp by API/System/AppDomainSetup

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

AppDomainSetup.ApplicationBase

 
using System;
class MainClass
{
    public static void Main()
    {
        AppDomainSetup setupInfo = new AppDomainSetup();

        setupInfo.ApplicationBase = @"C:\MyRootDirectory";
        setupInfo.ConfigurationFile = "MyApp.config";
        setupInfo.PrivateBinPath = "bin;plugins;external";
        AppDomain newDomain = AppDomain.CreateDomain("My New AppDomain", null, setupInfo);
    }
}


AppDomainSetup.ConfigurationFile

 

using System;
class Test
{
    public static void Main()
    {
        AppDomainSetup setupInfo = new AppDomainSetup();
        setupInfo.ApplicationBase = @"C:\MyRootDirectory";
        setupInfo.ConfigurationFile = "MyApp.config";
        setupInfo.PrivateBinPath = "bin;plugins;external";
        AppDomain newDomain = 
            AppDomain.CreateDomain("My New AppDomain", null, setupInfo);
    }
}


AppDomainSetup.PrivateBinPath

 
using System;
class Test
{
    public static void Main()
    {
        AppDomainSetup setupInfo = new AppDomainSetup();
        setupInfo.ApplicationBase = @"C:\MyRootDirectory";
        setupInfo.ConfigurationFile = "MyApp.config";
        setupInfo.PrivateBinPath = "bin;plugins;external";
        AppDomain newDomain = 
            AppDomain.CreateDomain("My New AppDomain", null, setupInfo);
    }
}


new AppDomainSetup()

 
using System;
class MainClass
{
    public static void Main()
    {
        AppDomainSetup setupInfo = new AppDomainSetup();

        setupInfo.ApplicationBase = @"C:\MyRootDirectory";
        setupInfo.ConfigurationFile = "MyApp.config";
        setupInfo.PrivateBinPath = "bin;plugins;external";
        AppDomain newDomain = AppDomain.CreateDomain("My New AppDomain", null, setupInfo);
    }
}