I\'ve got an assembly containing several WCF services, each with its own contract. It all works nicely. The service config in the app.config for the service looks like this:
You can also set the base addresses in code if you use a custom ServiceHostFactory.
In config you can have some app setting:
Then make a custom ServiceHostFactory:
public sealed class MyServiceHostFactory : ServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
var baseAddy = ConfigurationManager.AppSettings["BaseAddress"];
baseAddresses.Add(new Uri(baseAddy));
return new ServiceHost(serviceType, baseAddresses);
}
}
Then you also have to change your .svc files to use that factory:
<%@ ServiceHost Language="C#" Debug="true" Service="MyApp.MyService" CodeBehind="MyService.svc.cs" Factory="MyApp.MyServiceHostFactory" %>