【发布时间】:2020-07-09 15:28:49
【问题描述】:
我创建了一个 Windows 服务并使用 installutil.exe 安装它。
但即使 HTTPGetEnabled 设置为 true,我也无法访问“MEX”端点。 总是收到错误“此服务的元数据发布当前已禁用。”
你能帮我解决这个问题吗?
下面是我的 App.Config 文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name ="MyBehaviour">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="GenerateResult.GenerateResult" behaviorConfiguration="MyBehaviour">
<endpoint address="http://localhost:5050/GetResultService" binding="basicHttpBinding"
bindingConfiguration="" contract="GenerateResult.IGenerateResult" />
<endpoint address="http://localhost:5050/GetResultService/mex"
binding="mexHttpBinding"
bindingConfiguration="" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
【问题讨论】:
标签: c# wcf wsdl windows-services