我有一个netTcp WCF
服务在远程机器上的 Windows 服务中运行。windows服务以用户身份运行mydomain\u2
Windows 服务托管 WCF的.config
文件是
<security mode="None">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
现在当我跑
svcutil.exe http://wcfhostmachine:8000/MyWCFService?wsdl
客户端output.config
具有以下安全部分:
<security mode="None">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
它们是不同的。为什么??我应该更改客户端以匹配服务器吗?
虽然我仍然可以向WCF
服务发送指令并对其进行处理,但当 Visual Studio 尝试进入WCF
远程主机上运行的代码时,我得到了臭名昭著的:
无法自动调试“.....”。连接到服务器计算机失败。目标计算机上的 Visual Studio 远程调试器无法连接回此计算机。确保DNS
在目标计算机上正确配置。
不用说DNS
很好。
我能想到我遇到这种情况的唯一其他原因是因为我的 Visual Studio 运行为mydomain\u1
并且服务在远程计算机上运行为mydomain\u2
.
过去有没有人面临/解决过这个问题?
更多信息
下面是我的主机服务的 App.config。我是否会因为没有 mex 端点而遇到此问题?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="my.Indexer" behaviorConfiguration="IndexerServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://hostmachine:8000/Indexer"/>
</baseAddresses>
</host>
<endpoint address="net.tcp://hostmachine:9000/Indexer"
binding="netTcpBinding"
bindingConfiguration="Binding1"
contract="my.IIndexer" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="Binding1"
hostNameComparisonMode="StrongWildcard"
sendTimeout="00:10:00"
maxReceivedMessageSize="65536"
transferMode="Buffered"
portSharingEnabled="false">
<security mode="None">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="IndexerServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>