WCF Discovery returns hard-coded URL

筅森魡賤 提交于 2019-11-30 12:47:50

You should be able to fix this by replacing localhost with a wildcard:

<baseAddresses><add baseAddress="net.tcp://*:1234/My/Service" /></baseAddresses>

Don't use the config.

Run the service programatically.

Here's an example of adding endpoints programtically: Programmatic_Endpoint_Configuration

And this, for comparison: Self-hosting_and_base_addresses

Another option other than wildcard is to use the machine's DNS-resolvable hostname instad of localhost.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!