windows 服务无法启动。服务进程无法连接到服务控制器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4377502/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Service cannot be started. The service process could not connect to the service controller
提问by BreakHead
I Created a Sample WCF service and was trying to host in Windows Service, I installed the service using InstallUtility.exe but When I tried to start the service it give the error "Service cannot be started. The service process could not connect to the service controller " in EventLog and also it pop up the services stop automatically if they have no use.
我创建了一个示例 WCF 服务并试图在 Windows 服务中托管,我使用 InstallUtility.exe 安装了该服务,但是当我尝试启动该服务时,它给出了错误“服务无法启动。服务进程无法连接到该服务控制器“在EventLog中,如果没有用,它也会弹出服务自动停止。
Any Idea how can I proceed further and can access WCF services..
任何想法我怎样才能进一步进行并可以访问 WCF 服务..
Best Regards
此致
回答by rerun
Your service threw an error before it was able to open you servicehost first step I would take is add a catch and a trace write for any caught errors. If that doesn't do the trick you need to use system.Diagnostics.Debugger.Launchto see whats up.
您的服务在能够打开您的 servicehost 之前抛出了一个错误,我将采取的第一步是为任何捕获的错误添加一个捕获和一个跟踪写入。如果这不起作用,您需要使用system.Diagnostics.Debugger.Launch来查看发生了什么。