AppDomainSetup.ApplicationBase 속성

정의

애플리케이션이 들어 있는 디렉터리의 이름을 가져오거나 설정합니다.Gets or sets the name of the directory containing the application.

public:
 property System::String ^ ApplicationBase { System::String ^ get(); };
public:
 property System::String ^ ApplicationBase { System::String ^ get(); void set(System::String ^ value); };
public string ApplicationBase { get; }
public string ApplicationBase { get; set; }
member this.ApplicationBase : string
member this.ApplicationBase : string with get, set
Public ReadOnly Property ApplicationBase As String
Public Property ApplicationBase As String

속성 값

애플리케이션 기준 위치 디렉터리의 이름입니다.The name of the application base directory.

구현

예제

다음 예제에서는 사용 하는 방법에 설명 합니다 ApplicationBase 여기서 어셈블리 로더는 새 애플리케이션 도메인에 로드 하는 어셈블리에 대 한 조사를 시작 위치를 설정 하는 속성입니다.The following example demonstrates how to use the ApplicationBase property to set the location where the assembly loader begins probing for assemblies to load into a new application domain.

참고

지정한 폴더가 있는지 확인 해야 합니다.You must ensure that the folder you specify exists.

using namespace System;

int main()
{
    AppDomain^ root = AppDomain::CurrentDomain;

    AppDomainSetup^ setup = gcnew AppDomainSetup();
    setup->ApplicationBase = 
        root->SetupInformation->ApplicationBase + "MyAppSubfolder\\";

    AppDomain^ domain = AppDomain::CreateDomain("MyDomain", nullptr, setup);

    Console::WriteLine("Application base of {0}:\r\n\t{1}", 
        root->FriendlyName, root->SetupInformation->ApplicationBase);
    Console::WriteLine("Application base of {0}:\r\n\t{1}", 
        domain->FriendlyName, domain->SetupInformation->ApplicationBase);

    AppDomain::Unload(domain);
}

/* This example produces output similar to the following:

Application base of MyApp.exe:
        C:\Program Files\MyApp\
Application base of MyDomain:
        C:\Program Files\MyApp\MyAppSubfolder\
 */
using System;

class ADSetupInformation
{
    static void Main()
    {
        AppDomain root = AppDomain.CurrentDomain;

        AppDomainSetup setup = new AppDomainSetup();
        setup.ApplicationBase =
            root.SetupInformation.ApplicationBase + @"MyAppSubfolder\";

        AppDomain domain = AppDomain.CreateDomain("MyDomain", null, setup);

        Console.WriteLine("Application base of {0}:\r\n\t{1}",
            root.FriendlyName, root.SetupInformation.ApplicationBase);
        Console.WriteLine("Application base of {0}:\r\n\t{1}",
            domain.FriendlyName, domain.SetupInformation.ApplicationBase);

        AppDomain.Unload(domain);
    }
}

/* This example produces output similar to the following:

Application base of MyApp.exe:
        C:\Program Files\MyApp\
Application base of MyDomain:
        C:\Program Files\MyApp\MyAppSubfolder\
 */
Class ADSetupInformation

    Shared Sub Main()

        Dim root As AppDomain = AppDomain.CurrentDomain

        Dim setup As New AppDomainSetup()
        setup.ApplicationBase = _
            root.SetupInformation.ApplicationBase & "MyAppSubfolder\"

        Dim domain As AppDomain = AppDomain.CreateDomain("MyDomain", Nothing, setup)

        Console.WriteLine("Application base of {0}:" & vbCrLf & vbTab & "{1}", _
            root.FriendlyName, root.SetupInformation.ApplicationBase)
        Console.WriteLine("Application base of {0}:" & vbCrLf & vbTab & "{1}", _
            domain.FriendlyName, domain.SetupInformation.ApplicationBase)

        AppDomain.Unload(domain)
    End Sub
End Class

' This example produces output similar to the following:
'
'Application base of MyApp.exe:
'        C:\Program Files\MyApp\
'Application base of MyDomain:
'        C:\Program Files\MyApp\MyAppSubfolder\

설명

애플리케이션 기본 디렉터리는 여기서 어셈블리 manager 어셈블리에 대 한 조사를 시작 합니다.The application base directory is where the assembly manager begins probing for assemblies.

ApplicationBase 속성은 애플리케이션 도메인에 부여 되는 권한에 영향을 줄 수 있습니다.The ApplicationBase property can influence which permissions are granted to an application domain. 예를 들어, 일반적으로 로컬 컴퓨터에서 시작 된 애플리케이션 도메인에는 원래 위치에 따라 완전 신뢰가 부여 합니다.For example, an application domain originating from the local computer normally receives full trust based on its location of origin. 그러나 경우는 ApplicationBase 속성의 AppDomain 인트라넷 디렉터리의 전체 이름으로 설정 됩니다는 ApplicationBase 설정은 부여 된 권한을 애플리케이션 도메인 LocalIntranet 권한 부여에도 애플리케이션 도메인 제한 실제로 로컬 컴퓨터에서 발생 합니다.However, if the ApplicationBase property of that AppDomain is set to the full name of an intranet directory, the ApplicationBase setting restricts the permissions granted to the application domain to a LocalIntranet grant even though the application domain actually originates from the local computer.

적용 대상