我已按照本教程构建我的聊天应用程序。当我尝试添加对我的服务的引用时,我收到以下错误:
合同需要 Duplex,但绑定“BasicHttpBinding”不支持它或未正确配置以支持它。
我的 web.config 如下:
<extensions>
<bindingExtensions>
<add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,System.ServiceModel.PollingDuplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</bindingExtensions>
</extensions>
<bindings>
<pollingDuplex>
<binding name="chatPollingDuplex" duplexMode="MultipleMessagesPerPoll"/>
</pollingDuplex>
</bindings>
<services>
<service name="PrototypeSite.ChatService">
<endpoint address="" binding="pollingDuplex" bindingConfiguration="chatPollingDuplex" contract="PrototypeSite.ChatService" />
<endpoint address="mex" binding="wsDualHttpBinding" contract="IMetadataExchange"/>
</service>
</services>