Compartilhar via


SectionInformation.InheritInChildApplications Propriedade

Definição

Obtém ou define um valor que indica se as configurações especificadas na seção de configuração associada são herdadas por aplicativos que residem em um subdiretório do aplicativo relevante.

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

Valor da propriedade

true se as configurações especificadas neste ConfigurationSection objeto forem herdadas por aplicativos filho; caso contrário, false. O padrão é true.

Exemplos

O exemplo a seguir mostra como obter o InheritInChildApplications valor de um ConfigurationSection objeto.

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

Comentários

A InheritInChildApplications propriedade representa o inheritInChildApplications atributo de um location elemento em um arquivo de configuração.

Defina InheritInChildApplications para false impedir que configurações específicas para um determinado local (como o diretório raiz de um site) sejam herdadas por aplicativos que existem em subdiretórios.

O exemplo a seguir mostra como usar esse atributo em um arquivo de configuração para especificar que as configurações definidas no location elemento para a raiz de um site não devem ser herdadas por aplicativos filho:

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

A InheritInChildApplications propriedade se aplica apenas às configurações específicas do local.

Observação

O inheritInChildApplications atributo afeta somente aplicativos filho (diretórios virtuais/aplicativos configurados no IIS). Uma subpasta regular sem sua própria web.config faz parte do aplicativo pai, portanto, as configurações do location aplicativo pai continuam a ser aplicadas independentemente do inheritInChildApplications valor.

Aplica-se a