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>
1
  • I ended up doing the really simple #DEBUG way... eventually Ill use web.config transformations.. almost the same Commented Dec 28, 2010 at 20:46

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.