ContextInformation.HostingContext 属性   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取正在计算配置属性的环境的上下文。
public:
 property System::Object ^ HostingContext { System::Object ^ get(); };public object HostingContext { get; }member this.HostingContext : objPublic 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。