Windows服务无法正常工作 [英] Windows Service not working

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

问题描述

嗨盖伊兹,

我创建了一个WCF服务库,用于接收msmq异步.它使用wcf测试客户端正常工作.我决定将其托管在Windows服务中.我成功注册了Windows服务..

问题是,当我启动该服务时,什么都没有发生,

HI Guyz,

Hi i created a WCF Service Library that receives msmq async. it worked properly using wcf test client.i decided to host it in windows service. i successfully registered the windowsservice..

the problem is, when i start the service nothing happens,,

推荐答案

可能有太多的问题原因.特别是特权不足的问题.

要开始对此问题进行调查,请授予Windows Service管理员特权.您可以在ServiceProcessInstaller的实现中做到这一点,请参见 http://msdn.microsoft .com/en-us/library/system.serviceprocess.serviceprocessinstaller.aspx [ ^ ].

如果此帐户更改无济于事,请使用类 System.Diagnostics.EventLog将详细的日志记录添加到系统事件日志中,请参阅
There could be too many reasons of the problem. In particular, it could be a matter of insufficient privileges.

To start investigation of the problem, give a Windows Service administrator''s privileges. You can do it in your implementation of ServiceProcessInstaller, see http://msdn.microsoft.com/en-us/library/system.serviceprocess.serviceprocessinstaller.aspx[^].

If this change of account does not help, add detailed logging to the system Event Log using the class System.Diagnostics.EventLog, see http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlog.aspx[^].

View the System Log using the applet event viewer:
%SystemRoot%\system32\eventvwr.msc /s



尝试找到执行中断的地方.使用调试器(由于在Visual Studio中被设计为仅由服务控制器托管,因此您将无法将其附加到Windows Server的进程中,因此无法启动).

当您再次陷入困境时,再问另一个问题,这次更加具体,并提供全面的问题报告和代码示例.



回答一个后续问题:阅读有关使用自托管WCF的信息:
http://msdn.microsoft.com /en-us/library/ms731758.aspx [ ^ ].

—SA



Try to find the point where the execution breaks. Use the debugger (you will need to attach it to the process of the Windows Server as you cannot start if in Visual Studio as it is designed to be hosted only by the Service Controller).

When and if you stuck again, ask another question, this time much more specific, with comprehensive issue report and code sample.



Answering a follow-up question: read about using self-hosted WCF: http://msdn.microsoft.com/en-us/library/ms731758.aspx[^].

—SA


我解决了这个问题,谢谢您的帮助.
i solved this problem, thanks for the help.


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

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