WCF Client TCP Error 10013 while connecting - only if connection to windows DC is present; net.tcp binding

核能气质少年 提交于 2019-12-13 05:49:23

问题


I set up a small WCF service in Duplex mode. The service is consumed within a Windows 8 App. The client computer is member of a Windows Domain. If the connection to the Domaincontroller is present, I get an Error:

TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions

This does not happen if the connection to the DC is established but the server and client are running on the same machine. Over a network connection however it fails.

Strangely, if I connect the Server and the client through a different network with no connection to the DC, everything works fine. I have tried setting up an accesspolicy.xml but this did not help.

Here is the server config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- Bei der Bereitstellung des Dienstbibliothekprojekts muss der Inhalt der Konfigurationsdatei der app.config-Datei 
  des Hosts hinzugefügt werden. System.Configuration unterstützt keine Konfigurationsdateien für Bibliotheken. -->
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="netTcpBindConfig">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service name="PizzaService.PizzaGame">
        <endpoint address="" binding="netTcpBinding" contract="PizzaService.IPizzaGame" bindingConfiguration="netTcpBindConfig">
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"  />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://host:8733/Design_Time_Addresses/PizzaService/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- Legen Sie die Werte unten vor der Bereitstellung 
          auf "false" fest, um die Veröffentlichung von Metadateninformationen zu vermeiden. -->
          <serviceMetadata />
          <!-- Damit in Fehlern Ausnahmedetails zum Debuggen angezeigt werden, 
          legen Sie den Wert unten auf "true" fest. Legen Sie ihn vor der Bereitstellung auf "false" fest, 
          um die Veröffentlichung von Ausnahmeinformationen zu vermeiden. -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

回答1:


Okay, this can be considered solved. A Windows 8 app needs the Permission "Private Network (Client and Server)" requested in the app settings in Visual Studio.



来源:https://stackoverflow.com/questions/12244875/wcf-client-tcp-error-10013-while-connecting-only-if-connection-to-windows-dc-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!