Click here to Skip to main content
16,016,580 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an application in c# .net framework 3.0 with WCF service library inside Windows service. I have done all the functionality for both WCF service library and Windows Service. The solution has built successfully. When I am going to install my service using WIX setup, my service is installed correctly but getting the error dialog Cannot start windows service from the command line or a debugger. A windows service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Service Administrator tool or the NET START command. and the below exception at Eventlog.


C#
Service cannot be started. System.InvalidOperationException: Service 'WcfServiceLibrary1.WCFService' 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.EnsureThereAreApplicationEndpoints(ServiceDescription description)
   at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
   at System.ServiceModel.ServiceHostBase.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)



I have tried many options and I am really struggling on this. Please help me get rid of this so that I can just start my service successfully.
Posted
Updated 6-Apr-16 4:46am
Comments
[no name] 30-Aug-14 8:49am    
No, it is not installed successfully. The error message plainly tells you that. Then once you get that fixed, you need to fix the configuration for your communications.
Tutun2014 30-Aug-14 10:15am    
Yes you are very true. I can now understand that. The exception is also coming at Eventlog at the time of Service Installation. What should I do now? What options are left? Is it a problem of WCF? Please help.

refer This[^] link
 
Share this answer
 
Comments
Tutun2014 30-Aug-14 7:02am    
I have gone through this solutions, the service any way fails to start. I am worried about the exception at Event Log. Is the problem in app.config?
I think you might be forgetting to add the Config file for you Windows service to your WIX project. It should be installed to the same path as your Windows Service EXE
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900