我想在.NET 4.0中使用WCF的發現機制。它適用於Windows 7,但在XP機器上出現套接字異常時出現「請求的地址在其上下文中無效」(端點爲soap.udp://239.255.255.250:3702)時失敗。帶有發現的WCF失敗,套接字在XP上的上下文無效?
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>
這看起來很不舒服,就像我所看到的。這可能是答案,但我會堅持這樣做,希望結局更加開心! – Russ 2011-01-22 21:10:59
@Russ:我希望你能得到解決方案......我的感覺是存在問題,MS需要發佈HotFix。我建議你在Microsoft Connect上發帖,這樣至少有其他人會報告這個問題。祝你好運:) – 2011-01-22 21:14:56