I recently created a WCF service (dll) and a service host (exe). I know my WCF service is working correctly since I am able to successfully add the service to WcfTestClient.
I had the same problem. Everything works in VS2010 but when I run the same project in VS2008 I get the mentioned exception.
What I did in my VS2008 project to make it work was adding a call to the AddServiceEndpoint
member of my ServiceHost object.
Here is my code snippet:
Uri baseAddress = new Uri("http://localhost:8195/v2/SystemCallbackListener");
ServiceHost host = new ServiceHost(typeof(SystemCallbackListenerImpl), baseAddress);
host.AddServiceEndpoint(typeof(CsfServiceReference.SystemCallbackListener),
new BasicHttpBinding(),
baseAddress);
host.Open();
I didn't modify the app.config file. But I guess the service endpoint could also have been added in the .config file.