How to: Host WCF in a Windows Service Using TCP



I am trying to host WCF in a Windows Service, and I have created an example
form http://msdn.microsoft.com/en-us/library/cc949080.aspx#
but I am still getting an error message when I try to start the servrice

What am I doing wrong?

Thank You

Peter

Here's the error:

"The Service1 service on Local Computer started and then stopped. Some
services stop automatically if they have no work to do, for example, the
Performance Logs and Alerts service"

Here's the error from the Application Event Viewer

Event Type: Error
Event Source: Service1
Event Category: None
Event ID: 0
Date: 10/29/2009
Time: 2:31:35 PM
User: N/A
Computer: DEVCON1
Description:
Service cannot be started. System.InvalidOperationException: Service
'WindowsService1.Service1' has zero application (non-infrastructure)
endpoints. This might be because no configuration file was found for your
application, or because no service element matching the service name could
be found in the configuration file, or because no endpoints were defined in
the service element.
at
System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreNonMexEndpoints(ServiceDescription
description)
at
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription
description, ServiceHostBase serviceHost)
at System.ServiceModel.ServiceHostBase.InitializeRuntime()
at System.ServiceModel.ServiceHostBase.OnBeginOpen()
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan
timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at WindowsService1.Service1.OnStart(String[] args) in C:\Program
Files\...




.



Relevant Pages

  • Forms authentication doesnt timeout
    ... I have set up my configuration file like this: ... If the cookie does not exist on my machine, ... redirected to the login page, and after I signin, I am redirected back ... the timeout never seems to happen. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • yum-updatesd refuses to run
    ... message, timeout) ... due to security policies in the configuration file ... fedora-list mailing list ...
    (Fedora)
  • tcp timeout
    ... I'm using .NET 2.0 Remoting with tcp. ... run into a problem where my client program waits for over a minute before it ... I tried to control this through the configuration file, ... and a timeout when you actually make the remoting call? ...
    (microsoft.public.dotnet.framework.remoting)
  • tcp timeout
    ... I'm using .NET 2.0 Remoting with tcp. ... run into a problem where my client program waits for over a minute before it ... I tried to control this through the configuration file, ... and a timeout when you actually make the remoting call? ...
    (microsoft.public.dotnet.framework)