. , , , #if- , . - :
static void Main() {
TestClient client = new TestClient();
UpdateAddress(client.Endpoint);
}
static void UpdateAddress(ServiceEndpoint endpoint) {
string address = endpoint.Address.Uri.ToString();
int svcIndex = address.IndexOf(".svc");
int serviceIndex = address.LastIndexOf("/", svcIndex);
address = address.Substring(serviceIndex);
#if DEBUG
address = "http://localhost/App" + address;
#else
address = "http://myserver" + address;
#endif
endpoint.Address = new EndpointAddress(address);
}
, , , , , msbuild. IIRC msbuild, , .