2009-08-28 71 views
0

我有一個netTcp WCF服務在遠程計算機上的Windows服務中運行。 Windows服務運行爲用戶mydomain\u2調試netTcp WCF綁定

.config文件爲windows服務承載WCF是

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

回答

2

它們是相同的 - 在這種情況下所有相關的是兩端的mode =「None」。當您將模式設置爲無時,<security>標籤內的其餘部分完全無關緊要。

svcutil.exe創建的只是系統默認值。

Marc

+0

很高興知道 - 謝謝。 我現在將留下問題,看看其他人是否可以對我爲什麼仍然無法調試...... – Matt 2009-08-28 18:39:42