开发者

WCF with discovery fails with socket not valid in its context on XP?

开发者 https://www.devze.com 2023-02-05 23:06 出处:网络
I\'m trying to use WCF\'s discovery mechanism in .NET 4.0.It works on Windows 7 but fails on an XP machine with a socket exception saying that \"the requested address is not valid in its context\" (th

I'm trying to use WCF's discovery mechanism in .NET 4.0. It works on Windows 7 but fails on an XP machine with a socket exception saying that "the requested address is not valid in its context" (the endpoint is soap.udp://239.255.255.250:3702).

Is the Windows 7 vs XP a red herring? netstat 开发者_如何学运维doesn't seem to show any conflicts. What am I missing here?

I've created a simplified test service that shows the problem using the following config:

<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata/>
          <serviceDiscovery />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior>
          <endpointDiscovery />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <services>
      <service name="HelloWorldService">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/Demo"/>
          </baseAddresses>
        </host>
        <endpoint kind="mexEndpoint" />
        <endpoint kind="udpDiscoveryEndpoint" />
        <endpoint contract="Test.IHelloWorld" 
                  address="/Hello" 
                  binding="basicHttpBinding" />
      </service>
    </services>
  </system.serviceModel>
</configuration>


There is an issue logged on Microsoft Connect. Unfortunately there is currently no workaround and Microsoft response is

The exception you are mentioning is normally hit when trying to bind the socket to an IP address that isn't valid. Can you please check this and if possible try on a machine with a different OS. There are currently no known limitations of the WCF Discovery feature on XP.


Is the XP machine behind a firewall or router? To be specific, does the address 239.255.255.250 really belong to the XP machine, or does it actually use a NAT address? Try running ipconfig to see what it thinks it has.

0

精彩评论

暂无评论...
验证码 换一张
取 消