WCF 在使用另一个用户名启动服务后给出错误 10061

WCF gives error 10061 after starting the service with another username

我在专用的 windows 服务器上 运行ning 服务了一年多。 在我的客户端计算机上,我有一个使用 WCF

与此服务通信的 winforms 客户端

这已经一年多没有问题了。
但是现在公司政策发生了变化,我不得不使用 domain\administrator 帐户之外的另一个帐户启动服务。
使用的帐户也是域帐户,并且具有管理员权限。

但由于我的 winforms 客户端无法再连接到它,所以我总是收到此错误:

---------------------------
Could not connect to net.tcp://localhost:8001/CommunicationService. 
The connection attempt lasted for a time span of 00:00:02.0176000. 
TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8001. 
---------------------------

所以我想我需要给某些东西一些权利,但我对此一无所知。
有人可以解释我需要做什么才能让它再次工作吗?

请记住,服务和客户端都没有以任何方式更改,并且在我不得不使用另一个用户帐户启动服务之前它一直运行良好。
所以我认为这不应该是防火墙问题,也不应该是我的代码中的任何错误。

编辑:
这是服务的配置文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
   <system.serviceModel>
      <services>
         <service name="CommunicationService" behaviorConfiguration="debug">
            <endpoint address="net.tcp://localhost:8001/CommunicationService" binding="netTcpBinding" contract="ICommunication"/>
         </service>
      </services>
    <bindings>
      <netTcpBinding>
        <binding>
          <security mode="None"></security>
        </binding>
      </netTcpBinding>
    </bindings>
      <behaviors>
        <serviceBehaviors>
          <behavior name="debug">
            <serviceDebug includeExceptionDetailInFaults="true" />
          </behavior>
        </serviceBehaviors>
      </behaviors>
   </system.serviceModel>
</configuration>

这是我的客户的配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <system.serviceModel>
    <client>
      <endpoint address="net.tcp://192.0.137.198:8001/CommunicationService" binding="netTcpBinding" contract="ICommunication"/>
    </client>
    <bindings>
      <netTcpBinding>
        <binding sendTimeout="00:00:05">
      <security mode="None"></security>
    </binding>
      </netTcpBinding>
    </bindings>
  </system.serviceModel>  
</configuration>

编辑:

如果我 运行 客户端与服务位于同一台计算机上,它就无法正常工作。 我试过这个

netsh http add urlacl url=http://127.0.0.1:8001/MyUri user=domain\user 

但这里没有帮助。我在这里找到了这个命令 但我不知道我需要为它使用什么参数

成功了。 看来我的客户端配置文件有误,它的端点被设置为 127.0.0.1 而不是指向正确的服务。