user3611378
user3611378

Reputation: 43

Setting address in Wcf service dynamically

I have many wcf services in my application.My development server ,test server and production server are different.So when I deploy to different servers I have to change manually every time the service configuration and manually add the address.I think from best practice this is not desirable.

I want to add the address dynamically i.e when I deploy to different address it should automatically read the address. Please help me how to implement that.

Upvotes: 0

Views: 42

Answers (1)

The other other Alan
The other other Alan

Reputation: 1918

When you deploy a service, there should be no need to specify the server address. Are you referring to the address in the Web.config? If so, this should be a relative address which does not contain the server name, just the folder path relative to the root. Client, of course, need to specify which environment they wish to access, but this can be programmable and set at run-time so the same client can access different servers. Please let me know if you need more details.

Upvotes: 1

Related Questions