.NET WCF REST: Service ‘MyService’ implements multiple ServiceContract types, and no endpoints are defined in the configuration file.

Posted on 01 August, 2012 in Products

If you get the following .NET exception (I did using multiple REST services in one project):

Service ‘MyService’ implements multiple ServiceContract types, and no endpoints are defined in the configuration file. WebServiceHost can set up default endpoints, but only if the service implements only a single ServiceContract. Either change the service to only implement a single ServiceContract, or else define endpoints for the service explicitly in the configuration file.

...ensure you have the ServiceContract attribute on your interface.

[ServiceContract]
public interface IRolesService