WCF Discovery returns hard-coded URL

后端 未结 3 778
名媛妹妹
名媛妹妹 2021-01-02 04:53

The grand design is the following:

  1. There is certain application that gets installed as a Windows Service
  2. There may be several of these on the network<
相关标签:
3条回答
  • 2021-01-02 05:17

    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

    0 讨论(0)
  • 2021-01-02 05:18

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

    <baseAddresses><add baseAddress="net.tcp://*:1234/My/Service" /></baseAddresses>
    
    0 讨论(0)
  • 2021-01-02 05:23

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

    0 讨论(0)
提交回复
热议问题