ServiceHost only supports class service types
问题 I have a service named WcfService2 (original i know) which has an IService.cs file with a public interface: namespace WcfService2 { [ServiceContract] public interface IService1 { [OperationContract] [WebGet(UriTemplate = "/{value}")] string GetData(string value); } } I then have my public class Service1.svc.cs file which returns a string for the value like so: namespace WcfService2 { public class Service1 : IService1 { public string GetData(string value) { return string.Format("You entered: