The first piece of code above (for dev environment) can go to Web.config
(or Web.debug.config
but have to add xdt
transform as well). In your Web.release.config
(this one will go to staging environment) define the following element.
<endpoint address="http://servicessta.host.com/RPUtilityServices/LogException.svc/restService"
behaviorConfiguration="restfulBehavior"
binding="webHttpBinding"
contract="Host.RP.Shared.Common.Services.Utility.Interfaces.IExceptionUtilityService"
name="LogService" xdt:Transform="Replace" />
Note that I added xdt:Transform="Replace" in the release config file. With this attribute present the settings defined within the endpoint
element will replace those in your base Web.config
file.
For more information see MSDN.
UPDATE:
Using the xdt:Transform="Replace"
would replace the entire <endpoint />
element. To selectively replace the address
attribute of the <endpoint />
element use the following transform.
<endpoint address="http://servicessta.host.com/RPUtilityServices/LogException.svc/restService"
xdt:Transform="SetAttributes(address)"/>
(Note that if there are several <endpoint />
elements you might want to use the Locator attribute as well.)
What I said is described in detail on the MSDN page I posted above.