ContextInformation.HostingContext Свойство

Определение

Возвращает контекст среды, в которой определяется свойство конфигурации.

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

Значение свойства

Объект определяет среду, в которой было определено свойство конфигурации.

Примеры

В следующем примере кода показано, как использовать HostingContext свойство .

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

Комментарии

Возможное HostingContext значение : WebContext, ExeContextили null.

Применяется к

См. также раздел