【问题标题】:How do I avoid switching WCF endpoint when I deploy from localhost --> server?从 localhost --> 服务器部署时如何避免切换 WCF 端点?
【发布时间】:2011-05-31 08:29:06
【问题描述】:

现在我需要继续更改下面的行。有没有一种编程方式来检查我是在本地运行网站还是在生产环境中运行网站?

我得到的最接近的是这篇文章,但它似乎指的是 Silverlight,我只是从一个 asp.net 站点打来的。

Silverlight application cannot accesss WCF services on other machines

<client>
  <endpoint address="http://www.punkoutersoftware.com/Service1.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
</client>

【问题讨论】:

  • 我最终采用了非常简单的#DEBUG 方式......最终我将使用 web.config 转换......几乎一样

标签: wcf web-services endpoint


【解决方案1】:

这是针对 ASP.NET 应用程序的吗?如果是这样,请考虑使用 VS2010 的 Web.config Transformation,它可以根据您的构建类型(发布、调试等)更改您的 web.config。


Here's a better introductory tutorial

【讨论】:

    【解决方案2】:

    【讨论】:

      猜你喜欢
      • 2020-11-07
      • 2018-11-29
      • 2012-01-30
      • 1970-01-01
      • 2016-06-30
      • 1970-01-01
      • 2017-07-02
      • 2011-06-15
      • 2010-11-15
      相关资源
      最近更新 更多