views:

355

answers:

1

I have a netTcp WCF service running in a windows service on a remote machine. The windows service is running as user mydomain\u2

The .config file for the windows service hosted WCF is

<security mode="None">
            <transport clientCredentialType="None" />
            <message clientCredentialType="None" />
</security>

Now when I run

svcutil.exe http://wcfhostmachine%3A8000/MyWCFService?wsdl

The client output.config has the following security portion:

<security mode="None">
     <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
     <message clientCredentialType="Windows" />
</security>

They are different. WHY?? SHOULD I CHANGE THE CLIENT TO MATCH THE SERVER??

While I can still send instructions to the WCF service and they are processed, when Visual Studio tries to step into the WCF code running on the remote host, I get the infamous:

Unable to automatically debug '....'. Connecting to the server machine failed. The Visual Studio remote debugger on the target computer cannot connect back to this computer. Ensure that DNS is correctly configured on the target computer.

Needless to say DNS is fine.

The only other reason I can think of why I am running into this situation is because my Visual Studio is running as mydomain\u1 and the service is running on the remote machine as mydomain\u2.

Has any one faced/solved this issue in the past?

MORE INFO

Below is my App.config for the host service. Could I be encountering this issue because I don't have a mex endpoint?

<?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"/&gt;
          </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>
+1  A: 

They are the same - all that's relevant in this case is the mode="None" on both ends. The rest inside the <security> tag is totally irrelevant once you've set mode to None.

What the svcutil.exe creates are just the system defaults.

Marc

marc_s
Good to know -- thanks.I'll leave the question open for now to see if others can chime in on why I can't debug still....
Matt