【发布时间】:2015-10-13 07:22:26
【问题描述】:
我正在使用 wcf 服务托管一个 Web 应用程序。所以每当我添加一个新的 serviceReference 时,下面的代码就会出现在我的 web.config 文件中,这是显而易见的
<endpoint address="http://localhost:8426/WcfService1/Service1.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
现在我的问题是每次添加 serviceReference 端点地址时都会添加。我想将该端点地址设为静态。存储在 web.Config 中的某个位置。
更改背后的想法是,当我要在不同的服务器上托管时,可能会有超过 100 个 serviceReference。所以每次我都不能改变 100 个端点地址。那么如何使其成为静态并访问它。
【问题讨论】:
标签: c# asp.net wcf web-config