title: WCF Service Reference generates an empty reference.cs due to DuplexBinding
body: <p>I have WCF service. Here is configuration</p>
  
  <pre><code>  &lt;basicHttpBinding&gt;
      &lt;binding name="EmergencyRegistratorBinding"&gt;
        &lt;security mode="TransportCredentialOnly"&gt;
          &lt;transport clientCredentialType="Windows" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;
  </code></pre>
  
  <p>And service configuration</p>
  
  <pre><code>  &lt;service behaviorConfiguration="Default" name="Breeze.AppServer.Emergencies.EmergencyRegistrator"&gt;
      &lt;endpoint address="" binding="basicHttpBinding" bindingConfiguration="EmergencyRegistratorBinding"
          contract="Services.IEmergencyRegistrator" /&gt;
    &lt;/service&gt;
  </code></pre>
  
  <p>Everything worked fine. But I needed to change basicHttpBingind to DuplexBinding.
  I have added extention:</p>
  
  <pre><code>&lt;extensions&gt;
    &lt;bindingElementExtensions&gt;
      &lt;add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex"/&gt;
    &lt;/bindingElementExtensions&gt;
  &lt;/extensions&gt;
  </code></pre>
  
  <p>And changed mentioned above lines to:</p>
  
  <pre><code>  &lt;customBinding&gt;
      &lt;binding name="DuplexmergencyRegistratorBinding"&gt;
        &lt;binaryMessageEncoding/&gt;
        &lt;pollingDuplex maxPendingSessions="2147483647" maxPendingMessagesPerSession="2147483647" inactivityTimeout="02:00:00" serverPollTimeout="00:05:00"/&gt;
        &lt;httpTransport authenticationScheme="Negotiate"/&gt;
      &lt;/binding&gt;
    &lt;/customBinding&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>  &lt;service behaviorConfiguration="Default" name="Breeze.AppServer.Emergencies.EmergencyRegistrator"&gt;
      &lt;endpoint address="" binding="customBinding" bindingConfiguration="DuplexmergencyRegistratorBinding" contract="Breeze.Core.Services.IEmergencyRegistrator" /&gt;
      &lt;endpoint address="mex" binding="customBinding" bindingConfiguration="DuplexmergencyRegistratorBinding" contract="IMetadataExchange"/&gt;
    &lt;/service&gt;
  </code></pre>
  
  <hr>
  
  <p>I have added Service Reference to WCF project. Reference was successfully added but Reference.cs was almost empty. </p>
  
  <pre><code>//------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //     This code was generated by a tool.
  //     Runtime Version:4.0.30319.225
  //
  //     Changes to this file may cause incorrect behavior and will be lost if
  //     the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  </code></pre>
  
  <p>When I uncheck option "<strong>Reuse types in referenced assemblies</strong>"
  Code is generated but there above 10 thousands lines instead of ~500</p>
  
  <p>I run svcutil and I've got next:</p>
  
  <blockquote>
    <p>svcutil.exe <a href="http://localhost/Breeze.Workstation/Emergencies/EmergencyRegistrator.svc?wsdl" rel="nofollow">http://localhost/Breeze.Workstation/Emergencies/EmergencyRegistrator.svc?wsdl</a></p>
  </blockquote>
  
  <p>Attempting to download metadata from 'http://localhost/Breeze.Workstation/Emergencies/EmergencyRegistrator.svc?wsdl' using WS-Metadata Exchange or DISCO.
  Warning: The following Policy Assertions were not Imported:
    XPath://wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='CustomBinding_IEmergencyRegistrator']
    Assertions: ..</p>
  
  <p>Generating files...
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\EmergencyRegistrator.cs
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\output.config</p>
  
  <p>I'm quite new to WCF services. I hope somebody will be able to help me.
  Thanks.</p>