0

Right now I need to keep changing the line below. Is there a programmatic way to check if I am running the site locally vs. on production ?

The closest I got was this post but it seems to be referring to Silverlight and I am just calling from an asp.net site.

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>
Community
  • 1
  • 1
punkouter
  • 5,170
  • 15
  • 71
  • 116
  • I ended up doing the really simple #DEBUG way... eventually Ill use web.config transformations.. almost the same – punkouter Dec 28 '10 at 20:46

2 Answers2

2

Is this for an ASP.NET application? If so, consider using VS2010's Web.config Transformation, which can alter your web.config based on your build type (Release, Debug, etc).


Here's a better introductory tutorial

STW
  • 44,917
  • 17
  • 105
  • 161
0

A very similar situation is covered here: How to programmatically modify WCF app.config endpoint address setting?

Community
  • 1
  • 1
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252