连接时 WCF 客户端 TCP 错误 10013 - 仅当连接到 Windows DC 时;net.tcp 绑定 [英] WCF Client TCP Error 10013 while connecting - only if connection to windows DC is present; net.tcp binding

查看:26
本文介绍了连接时 WCF 客户端 TCP 错误 10013 - 仅当连接到 Windows DC 时;net.tcp 绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在双工模式下设置了一个小型 WCF 服务.该服务在 Windows 8 应用程序中使用.客户端计算机是 Windows 域的成员.如果存在与域控制器的连接,则会出现错误:

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

如果与 DC 的连接已建立但服务器和客户端在同一台机器上运行,则不会发生这种情况.但是通过网络连接失败.

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.

奇怪的是,如果我通过不同的网络连接服务器和客户端,而没有连接到 DC,一切正常.我曾尝试设置 accesspolicy.xml 但这没有帮助.

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.

这里是服务器配置:

<?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>

推荐答案

好的,这个也算是解决了.Windows 8 应用需要在 Visual Studio 的应用设置中请求的权限专用网络(客户端和服务器)".

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.

这篇关于连接时 WCF 客户端 TCP 错误 10013 - 仅当连接到 Windows DC 时;net.tcp 绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆