我在控制台应用程序中配置轮询双工绑定时遇到问题。这是我收到的错误:
Configuration binding extension 'system.serviceModel/bindings/pollingDuplexHttpBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.
另外,这是我的 app.config 中的一个片段:
<extensions>
<bindingExtensions>
<add name="pollingDuplexHttpBinding" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,
System.ServiceModel.PollingDuplex,
Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</bindingExtensions>
</extensions>
<services>
<service behaviorConfiguration="PositionBehaviour" name="RabbitMQSub.PositionUpdates">
<endpoint address="positionsDUPLEX" binding="pollingDuplexHttpBinding" contract="RabbitMQSub.IPositionUpdates">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/RabbitMQSub/PositionsDUPLEX" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="PositionBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceTimeouts transactionTimeout="10:00:00"/>
<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500" maxConcurrentInstances="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
问题
- 甚至可以在控制台应用程序中配置轮询双工吗?
- 如果是这样,我做错了什么?
谢谢