SectionInformation.InheritInChildApplications プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
関連する構成セクションで指定された設定が、関連するアプリケーションのサブディレクトリにあるアプリケーションによって継承されるかどうかを示す値を取得または設定します。
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
プロパティ値
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 サイトのルート ディレクトリなど) に固有の設定がサブディレクトリに存在するアプリケーションによって継承されないようにするには、 InheritInChildApplications を false に設定します。
次の例は、構成ファイルでこの属性を使用して、Web サイトのルートの location 要素で定義されている設定を子アプリケーションで継承しないように指定する方法を示しています。
<location path="." inheritInChildApplications="false">
InheritInChildApplications プロパティは、場所固有の構成設定にのみ適用されます。
注
inheritInChildApplications属性は、子アプリケーション (IIS で構成された仮想ディレクトリ/アプリケーション) にのみ影響します。 独自の web.config のない通常のサブフォルダーは親アプリケーションの一部であるため、親アプリケーションの location 設定は、 inheritInChildApplications 値に関係なく引き続き適用されます。