다음을 통해 공유


AppDomainSetup.ConfigurationFile 속성

응용 프로그램 도메인의 구성 파일 이름을 가져오거나 설정합니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Property ConfigurationFile As String
‘사용 방법
Dim instance As AppDomainSetup
Dim value As String

value = instance.ConfigurationFile

instance.ConfigurationFile = value
public string ConfigurationFile { get; set; }
public:
virtual property String^ ConfigurationFile {
    String^ get () sealed;
    void set (String^ value) sealed;
}
/** @property */
public final String get_ConfigurationFile ()

/** @property */
public final void set_ConfigurationFile (String value)
public final function get ConfigurationFile () : String

public final function set ConfigurationFile (value : String)

속성 값

구성 파일의 이름을 지정하는 String입니다.

설명

구성 파일은 응용 프로그램 도메인에 대한 검색 규칙과 구성 데이터를 설명합니다. 상황에 따라 의미 있는 값이 달라지므로 응용 프로그램 도메인을 만든 호스트에서 이 데이터를 제공해야 합니다.

예를 들어, 각 응용 프로그램, 사이트 및 컴퓨터에 대해 ASP.NET 응용 프로그램의 구성 데이터가 저장되지만 각 응용 프로그램, 사용자 및 컴퓨터에 대해서는 실행 파일의 구성 데이터가 저장됩니다. 호스트에서만 특정 상황의 구성 데이터에 대한 사양을 인식합니다.

예제

Imports System
Imports System.Reflection
Imports System.Security.Policy 'for evidence object
Imports System.Security 'for securityzone object
Imports System.Collections 'for IEnumerator

Class ADCreateDomain
   
   Public Shared Sub Main()
      ' Create appdomainsetup information for new appdomain.
      Dim domaininfo As New AppDomainSetup()
      domaininfo.ApplicationBase = System.Environment.CurrentDirectory
      domaininfo.ConfigurationFile = System.Environment.CurrentDirectory & "\ADCreateDomain.exe.config"
      domaininfo.ApplicationName = "MyApplication"
      domaininfo.LicenseFile = System.Environment.CurrentDirectory & "\license.txt"
      
      'Create evidence for the new appdomain.
      Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence
      'Add the zone and url information to restrict permissions assigned to the appdomain.
      adevidence.AddHost(New Url("http://www.example.com"))
      adevidence.AddHost(New Zone(SecurityZone.Internet))
      
      ' Create the application domain.
      Dim newDomain As AppDomain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo)
      
      ' Write out the application domain information.
      Console.WriteLine("Host domain: " & AppDomain.CurrentDomain.FriendlyName)
      Console.WriteLine("child domain: " & newDomain.FriendlyName)
      Console.WriteLine()
      Console.WriteLine("Application base is: " & newDomain.SetupInformation.ApplicationBase)
      Console.WriteLine("Configuration file is: " & newDomain.SetupInformation.ConfigurationFile)
      Console.WriteLine("Application name is: " & newDomain.SetupInformation.ApplicationName)
      Console.WriteLine("License file is: " & newDomain.SetupInformation.LicenseFile)
      
      Dim newevidenceenum As IEnumerator = newDomain.Evidence.GetEnumerator()
      While newevidenceenum.MoveNext()
         Console.WriteLine(newevidenceenum.Current)
      End While 
      
      AppDomain.Unload(newDomain)
   End Sub 'Main 
End Class 'ADCreateDomain 
using System;
using System.Reflection;
using System.Security.Policy;  //for evidence object
using System.Security;  //for securityzone object
using System.Collections;  //for IEnumerator

class ADCreateDomain
{
    public static void Main()
    {
        // Create appdomainsetup information for the new appdomain.
        AppDomainSetup domaininfo = new AppDomainSetup();
        domaininfo.ApplicationBase = System.Environment.CurrentDirectory;
        domaininfo.ConfigurationFile = System.Environment.CurrentDirectory  + "\\ADCreateDomain.exe.config";
        domaininfo.ApplicationName = "MyApplication";
        domaininfo.LicenseFile = System.Environment.CurrentDirectory + "\\license.txt";

        //Create evidence for new appdomain.
        Evidence adevidence = AppDomain.CurrentDomain.Evidence;
        //Add the zone and url information to restrict permissions assigned to the appdomain.
        adevidence.AddHost(new Url("http://www.example.com"));
        adevidence.AddHost(new Zone(SecurityZone.Internet));

        // Create the application domain.
        AppDomain newDomain = AppDomain.CreateDomain("MyDomain", adevidence, domaininfo);

        // Write out the application domain information.
        Console.WriteLine("Host domain: " + AppDomain.CurrentDomain.FriendlyName);
        Console.WriteLine("child domain: " + newDomain.FriendlyName);
        Console.WriteLine();
        Console.WriteLine("Application base is: " + newDomain.SetupInformation.ApplicationBase);
        Console.WriteLine("Configuration file is: " + newDomain.SetupInformation.ConfigurationFile);
        Console.WriteLine("Application name is: " + newDomain.SetupInformation.ApplicationName);
        Console.WriteLine("License file is: " + newDomain.SetupInformation.LicenseFile);
        
        IEnumerator newevidenceenum = newDomain.Evidence.GetEnumerator();
        while(newevidenceenum.MoveNext())
            Console.WriteLine(newevidenceenum.Current);
        

        AppDomain.Unload(newDomain);
    
        
    }
    
}
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Policy;
//for evidence object
using namespace System::Security;
//for securityzone object
using namespace System::Collections;

//for IEnumerator
int main()
{
   
   // Create appdomainsetup information for the new appdomain.
   AppDomainSetup^ domaininfo = gcnew AppDomainSetup;
   domaininfo->ApplicationBase = System::Environment::CurrentDirectory;
   domaininfo->ConfigurationFile = System::Environment::CurrentDirectory + "\\ADCreateDomain.exe.config";
   domaininfo->ApplicationName = "MyApplication";
   domaininfo->LicenseFile = System::Environment::CurrentDirectory + "\\license.txt";
   
   //Create evidence for new appdomain.
   Evidence^ adevidence = AppDomain::CurrentDomain->Evidence;
   
   //Add the zone and url information to restrict permissions assigned to the appdomain.
   adevidence->AddHost( gcnew Url( "http://www.example.com" ) );
   adevidence->AddHost( gcnew Zone( SecurityZone::Internet ) );
   
   // Create the application domain.
   AppDomain^ newDomain = AppDomain::CreateDomain( "MyDomain", adevidence, domaininfo );
   
   // Write out the application domain information.
   Console::WriteLine( "Host domain: {0}", AppDomain::CurrentDomain->FriendlyName );
   Console::WriteLine( "child domain: {0}", newDomain->FriendlyName );
   Console::WriteLine();
   Console::WriteLine( "Application base is: {0}", newDomain->SetupInformation->ApplicationBase );
   Console::WriteLine( "Configuration file is: {0}", newDomain->SetupInformation->ConfigurationFile );
   Console::WriteLine( "Application name is: {0}", newDomain->SetupInformation->ApplicationName );
   Console::WriteLine( "License file is: {0}", newDomain->SetupInformation->LicenseFile );
   IEnumerator^ newevidenceenum = newDomain->Evidence->GetEnumerator();
   while ( newevidenceenum->MoveNext() )
      Console::WriteLine( newevidenceenum->Current );

   AppDomain::Unload( newDomain );
}
import System.*;
import System.Reflection.*;
import System.Security.Policy.*; //for evidence object
import System.Security.*;        //for securityzone object
import System.Collections.*;     //for IEnumerator
 
class ADCreateDomain
{
    public static void main(String[] args)
    {
        // Create appdomainsetup information for the new appdomain.
        AppDomainSetup domainInfo = new AppDomainSetup();

        domainInfo.set_ApplicationBase(System.Environment.get_CurrentDirectory());
        domainInfo.set_ConfigurationFile(System.Environment.get_CurrentDirectory() 
            + "ADCreateDomain.exe.config");
        domainInfo.set_ApplicationName("MyApplication");
        domainInfo.set_LicenseFile(
            System.Environment.get_CurrentDirectory() + "license.txt");

        //Create evidence for new appdomain.
        Evidence adEvidence = AppDomain.get_CurrentDomain().get_Evidence();

        //Add the zone and url information to restrict permissions 
        //assigned to the appdomain.
        adEvidence.AddHost(new Url("http://www.example.com"));
        adEvidence.AddHost(new Zone(SecurityZone.Internet));

        // Create the application domain.
        AppDomain newDomain = AppDomain.CreateDomain("MyDomain", adEvidence, 
            domainInfo);

        // Write out the application domain information.
        Console.WriteLine("Host domain: " 
            + AppDomain.get_CurrentDomain().get_FriendlyName());
        Console.WriteLine("child domain: " + newDomain.get_FriendlyName());
        Console.WriteLine();
        Console.WriteLine("Application base is: " 
            + newDomain.get_SetupInformation().get_ApplicationBase());
        Console.WriteLine("Configuration file is: " 
            + newDomain.get_SetupInformation().get_ConfigurationFile());
        Console.WriteLine("Application name is: " 
            + newDomain.get_SetupInformation().get_ApplicationName());
        Console.WriteLine("License file is: " 
            + newDomain.get_SetupInformation().get_LicenseFile());

        IEnumerator newEvidenceEnum = newDomain.get_Evidence().GetEnumerator();
        while (newEvidenceEnum.MoveNext()) {
            Console.WriteLine(newEvidenceEnum.get_Current());
        }

        AppDomain.Unload(newDomain);
    } //main 
} //ADCreateDomain 

.NET Framework 보안

플랫폼

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

AppDomainSetup 클래스
AppDomainSetup 멤버
System 네임스페이스