Windows服务无法启动 [英] Windows Service fails to start

查看:156
本文介绍了Windows服务无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c#.net framework 3.0中有一个应用程序,在Windows服务中有WCF服务库。我已经完成了WCF服务库和Windows服务的所有功能。该解决方案已成功构建。当我要使用WIX安装程序安装我的服务时,我的服务安装正确,但获取错误对话框无法从命令行或调试器启动Windows服务。首先必须安装Windows服务(使用installutil.exe),然后使用ServerExplorer,Windows服务管理员工具或NET START命令启动。以及事件日志中的以下异常。

< br $>


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.


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.

推荐答案

参考 [ ^ ]链接


我想您可能忘记将Windows服务的Config文件添加到您的WIX项目中。它应安装在与Windows Service EXE
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


这篇关于Windows服务无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆