Freigeben über


ContextInformation.HostingContext Eigenschaft

Definition

Ruft den Kontext der Umgebung ab, in der die Konfigurationseigenschaft ausgewertet wird.

public:
 property System::Object ^ HostingContext { System::Object ^ get(); };
public object HostingContext { get; }
member this.HostingContext : obj
Public ReadOnly Property HostingContext As Object

Eigenschaftswert

Ein Objekt, das die Umgebung angibt, in der die Konfigurationseigenschaft ausgewertet wird.

Beispiele

Im folgenden Codebeispiel wird die Verwendung der HostingContext Eigenschaft veranschaulicht.

// Create an object based on HostingContext.
WebContext myWC =
  (WebContext)config.EvaluationContext.HostingContext;
// Use the WebContext object to determine
// the ApplicationLevel.
Console.WriteLine("ApplicationLevel: {0}",
  myWC.ApplicationLevel);
' Create an object based on HostingContext.
Dim myWC As WebContext = _
  config.EvaluationContext.HostingContext
' Use the WebContext object to determine
' the ApplicationLevel.
Console.WriteLine("ApplicationLevel: {0}", _
  myWC.ApplicationLevel)

Hinweise

Der mögliche HostingContext Wert ist WebContext, , ExeContextoder null.

Gilt für:

Weitere Informationen