英語で読む

次の方法で共有


ContextInformation.HostingContext プロパティ

定義

構成プロパティが評価される環境のコンテキストを取得します。

C#
public object HostingContext { get; }

プロパティ値

構成プロパティが評価される環境を示すオブジェクト。

次のコード例では、 プロパティの使用方法を HostingContext 示します。

C#
// 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);

注釈

指定できる HostingContext 値は、 WebContextExeContext、または nullです。

適用対象

製品 バージョン
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

こちらもご覧ください