WebHttpBehavior.HelpEnabled 属性

定义

获取或设置一个值,该值确定是否启用了 WCF 帮助页。

public:
 virtual property bool HelpEnabled { bool get(); void set(bool value); };
public virtual bool HelpEnabled { get; set; }
member this.HelpEnabled : bool with get, set
Public Overridable Property HelpEnabled As Boolean

属性值

true 如果启用了 WCFHelp 页,则为 ;否则 false

注解

有关 WCF REST 帮助页的详细信息,请参阅 WCF Web HTTP 服务帮助页

若要在配置文件中启用 helpEnabled 属性,请执行以下操作:

<system.serviceModel>
    <behaviors>
        <endpointBehaviors>
            <behavior name="MyEndpointBehavior">
                <webHttp helpEnabled="true" />
            </behavior>
    </endpointBehaviors>
</system.serviceModel>

若要以编程方式启用 HelpEnabled 属性,

WebHttpBehavior helpBehavior = new WebHttpBehavior();
helpBehavior.HelpEnabled = true;
host.Description.Endpoints[0].Behaviors.Add(helpBehavior);

适用于