tags:

views:

23

answers:

1

I am inexperienced in WCF so this question may be real basic...
I have a WCF service hosted in IIS of a server named "Server1". This server is aliased and visible from the open Internet as ServerAlias.mydomain.com.
While developing the consumer application, I add a service reference to the service in Server1 and deploy it. When executing it remotely, the app looks for the service on "Server1.mydomain.com" but it can only be accessed through "ServerAlias.mydomain.com".

Is there a way that I can reference the service in Server1 in design-time, and in run-time the application looks in "ServerAlias"?

Thanks!

A: 

When you make the reference, it should create entries in your .config file which indicate the remote endpoint. All you have to do is change the remote endpoint to point to the other server and it should work.

casperOne
Thanks for your answer. But what I am looking for is to have 2 servers - one for design-time and one for run-time. Is this possible? Perhaps use one server based on the compiler directive for Release/Debug? Is it something I need to do manually?
Gustavo Cavalcanti
@Gustavo Cavalcanti: If you have two servers, you have two deployments, so you need two config files, just make sure the one in deployment points to the other server.
casperOne