AppDomainSetup.ApplicationBase AppDomainSetup.ApplicationBase AppDomainSetup.ApplicationBase AppDomainSetup.ApplicationBase Property


アプリケーションが格納されているディレクトリの名前を取得または設定します。Gets or sets the name of the directory containing the application.

 property System::String ^ ApplicationBase { System::String ^ get(); void set(System::String ^ value); };
public string ApplicationBase { get; set; }
member this.ApplicationBase : string with get, set
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);


/* 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);


/* 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)

    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\


アプリケーション ベース ディレクトリは、アセンブリのマネージャーがアセンブリのプローブを開始します。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.


パス情報にアクセスします。for access to the path information. 関連付けられた列挙体。 PathDiscoveryAssociated enumeration: PathDiscovery