次の方法で共有


SectionInformation.InheritInChildApplications プロパティ

定義

関連する構成セクションで指定された設定が、関連するアプリケーションのサブディレクトリにあるアプリケーションによって継承されるかどうかを示す値を取得または設定します。

public:
 property bool InheritInChildApplications { bool get(); void set(bool value); };
public bool InheritInChildApplications { get; set; }
member this.InheritInChildApplications : bool with get, set
Public Property InheritInChildApplications As Boolean

プロパティ値

この オブジェクトで指定された設定が子アプリケーションによって継承される場合は a0/& 。それ以外の場合は。 既定値は、true です。

次の例は、ConfigurationSection オブジェクトのInheritInChildApplications値を取得する方法を示しています。

static public void GetInheritInChildApps()
{
    SectionInformation sInfo =
        GetSectionInformation();

    bool inheritInChildApps =
        sInfo.InheritInChildApplications;
    Console.WriteLine("Inherit in child apps: {0}",
        inheritInChildApps.ToString());
}
Public Shared Sub GetInheritInChildApps() 

    Dim sInfo As SectionInformation = _
    GetSectionInformation()
    
    Dim inheritInChildApps As Boolean = _
    sInfo.InheritInChildApplications
    Console.WriteLine("Inherit in child apps: {0}", _
    inheritInChildApps.ToString())

End Sub

注釈

InheritInChildApplications プロパティは、構成ファイル内のlocation要素のinheritInChildApplications属性を表します。

特定の場所 (Web サイトのルート ディレクトリなど) に固有の設定がサブディレクトリに存在するアプリケーションによって継承されないようにするには、 InheritInChildApplicationsfalse に設定します。

次の例は、構成ファイルでこの属性を使用して、Web サイトのルートの location 要素で定義されている設定を子アプリケーションで継承しないように指定する方法を示しています。

<location path="." inheritInChildApplications="false">

InheritInChildApplications プロパティは、場所固有の構成設定にのみ適用されます。

inheritInChildApplications属性は、子アプリケーション (IIS で構成された仮想ディレクトリ/アプリケーション) にのみ影響します。 独自の web.config のない通常のサブフォルダーは親アプリケーションの一部であるため、親アプリケーションの location 設定は、 inheritInChildApplications 値に関係なく引き続き適用されます。

適用対象