Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight 4.0 要使此MSDN示例正常工作,我需要在web.config中修复什么?_Silverlight 4.0_Wcf_Pollingduplexhttpbinding - Fatal编程技术网

Silverlight 4.0 要使此MSDN示例正常工作,我需要在web.config中修复什么?

Silverlight 4.0 要使此MSDN示例正常工作,我需要在web.config中修复什么?,silverlight-4.0,wcf,pollingduplexhttpbinding,Silverlight 4.0,Wcf,Pollingduplexhttpbinding,使用Visual Studio 2010中的.NET 4和Silverlight 4,我尝试按照MSDN指南为Silverlight客户端()构建双工服务 Web.config发出警告: 警告26元素“bindings”具有无效的子元素 “pollingDuplexHttpBinding”。预期可能的要素清单: 'basicHttpBinding,customBinding,msmqIntegrationBinding, NetPeerCpBinding、netMsmqBinding、netNa

使用Visual Studio 2010中的.NET 4和Silverlight 4,我尝试按照MSDN指南为Silverlight客户端()构建双工服务

Web.config发出警告:

警告26元素“bindings”具有无效的子元素 “pollingDuplexHttpBinding”。预期可能的要素清单: 'basicHttpBinding,customBinding,msmqIntegrationBinding, NetPeerCpBinding、netMsmqBinding、netNamedPipeBinding、NetCpBinding、, wsFederationHttpBinding,ws2007FederationHttpBinding,wsHttpBinding, ws2007HttpBinding、wsDualHttpBinding、netTcpContextBinding、, wsHttpContextBinding、basicHttpContextBinding、mexHttpBinding、, MexHttpBinding、mexNamedPipeBinding、mexTcpBinding、, webHttpBinding’。C:\DuplexService\DuplexService\Web.config

我无法将服务引用添加到客户端。我无法在WCF测试客户端中加载服务。我在很多地方寻找过答案。我看不出有什么问题

web.config当前看起来如下所示:



使用此配置。。。它对我有用

<system.serviceModel>
<extensions>
  <bindingElementExtensions>
    <add name="pollingDuplex"
         type="System.ServiceModel.Configuration.PollingDuplexElement, 
         System.ServiceModel.PollingDuplex" />
  </bindingElementExtensions>
</extensions>
<bindings>
  <customBinding>
    <binding name="pollingDuplexBinding">
      <binaryMessageEncoding />
      <pollingDuplex maxPendingSessions="2147483647"   
                     maxPendingMessagesPerSession="2147483647" 
                     />
      <httpTransport />
    </binding>
  </customBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="sb">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
      <serviceThrottling maxConcurrentSessions="2147483647"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service name="DataServices" behaviorConfiguration="sb" >
    <endpoint address="" 
              binding="customBinding" 
              bindingConfiguration="pollingDuplexBinding"
              contract="DataServices.IDataService"/>
    <endpoint address="mex" 
              binding="mexHttpBinding" 
              contract="IMetadataExchange"/>
  </service>
</services>

我也有这个问题。通过添加

C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Server\System.ServiceModel.PollingDuplex.dll
指向WebRole项目的引用

C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Server\System.ServiceModel.PollingDuplex.dll