我正在尝试在 .NET 4.0 中使用 WCF 的发现机制。它在 Windows 7 上工作,但在 XP 机器上失败,并出现套接字异常,说“请求的地址在其上下文中无效”(端点是 soap.udp://239.255.255.250:3702)。
Windows 7 vs XP 是红鲱鱼吗?netstat 似乎没有显示任何冲突。我在这里想念什么?
我创建了一个简化的测试服务,使用以下配置显示问题:
<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>