8

I had a self-hosted win service WCF installed and running at one point.

Naturally, I had to make some changes. So I changed the base address back to my local workstation and made the changes. It worked fine.

Now it's time to redistribute and... Well... It keeps hosing and I can't figure it out.

From the app.config file:

<system.serviceModel>
<services>
  <service behaviorConfiguration="ExStreamWCF.Service1Behavior"
    name="ExStreamWCF.Service1">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
      contract="ExStreamWCF.IService1">
      <identity>
        <dns value="Devexstream-2" />
        <!--<dns value="vmwin2k3sta-tn2" />-->
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
      contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://Devexstream-2:8080/Service" />
        <!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ExStreamWCF.Service1Behavior">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

From the web.config file (long story):

  <system.serviceModel>
    <services>
  <service behaviorConfiguration="ExStreamWCF.Service1Behavior"
    name="ExStreamWCF.Service1">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
      contract="ExStreamWCF.IService1">
      <identity>
        <dns value="Devexstream-2" />
        <!--<dns value="vmwin2k3sta-tn2" />-->
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
      contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://Devexstream-2:8080/Service" />
        <!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ExStreamWCF.Service1Behavior">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

Any guesses on what I'm doing wrong?

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • What does the inner exception say? – Forgotten Semicolon May 20 '11 at 19:03
  • I honestly don't know how to find out what the inner exception says! –  May 20 '11 at 19:52
  • 2
    Enabled WCF tracing on the service (http://msdn.microsoft.com/en-us/library/ms733025.aspx), it will likely give you all the necessary information. If you're on a domain, I'd assume it's something causing kerberos to fail (like a missing or misconfigured SPN, or the base address using a hostname that doesn't match the SPN configured or is not known to the domain controllers). – tomasr May 20 '11 at 22:50

4 Answers4

3

Thanks tomasr, it was a misconfigured SPN.

Too bad there's no functionality on this site to close your own question, I'll have to wait 2 days to choose this one :-)

Thanks again!

  • 1
    in my case it was caused by the endpoint using a server address in upper case, changing to lower case resolved this immediately – Mr. Graves Sep 27 '11 at 15:00
2

i removed identity element from config for local testing when i was not connected to domain. It works.

reference -

http://blogs.msdn.com/b/jpsanders/archive/2010/10/14/wcf-client-inner-exception-quot-the-security-support-provider-interface-sspi-negotiation-failed-quot.aspx

vibhu
  • 1,657
  • 2
  • 15
  • 19
1
under the <system.serviceModel>
<bindings>
    <netTcpBinding>
        <binding name="netTcp">
            <security mode="None">
        </binding>
    </netTcpBinding>
</bindings>

add this to bindingConfiguration in the endpoint

ref: https://www.youtube.com/watch?v=KYDBjoCYAC4&list=PL6n9fhu94yhVxEyaRMaMN_-qnDdNVGsL1&index=53

0

Check for framework installed, framework 4.5.x should be used. It might be upgraded. Restore old version and it will work.

Iñigo
  • 1,877
  • 7
  • 25
  • 55