ContextInformation.HostingContext プロパティ

定義

構成プロパティが評価される環境のコンテキストを取得します。Gets the context of the environment where the configuration property is being evaluated.

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

プロパティ値

構成プロパティが評価される環境を示すオブジェクト。An object specifying the environment where the configuration property is being evaluated.

次のコード例は、HostingContext プロパティの使用方法を示しています。The following code example demonstrates how to use the HostingContext property.

// 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 値は、WebContextExeContext、または nullです。The possible HostingContext value is WebContext, ExeContext, or null.

適用対象

こちらもご覧ください