Windows 服务未执行 OnStart 入口点 [英] windows service not executing OnStart entry point

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

问题描述

我安装了 Windows 服务,

I have a windows service installed,

Some.WindowsService wService = new WindowsService();
Some.Server server = new Server();
Some.Service service = new Service();
Some.Request request = new Some.Request(msg, Id);
var ReturnedResult = server.Execute(request);

我检查了 Service,Some"在 Service 中正常运行.我不知道如何初始化以便我可以访问 WindowsService 中受保护的 OnStart() 函数,并使其可以调用 OnStart() 函数中的函数.

I checked in Service, the "Some" is running in Service normally. I don't know how to initialize so that I can reach the protected OnStart() function in WindowsService, and so that it can call the functions in OnStart() Function.

任何想法都值得赞赏.非常感谢.:)

Any idea are appreciated. Thanks a lot. : )

推荐答案

测试此问题的一种方法是编写日志文件或 windows 事件日志

One way you can test this is write a log file or the windows event log

System.Diagnostics.EventLog appLog = 
    new System.Diagnostics.EventLog() ;
appLog.Source = "This Application's Name";
appLog.WriteEntry("An entry to the Application event log.");

这篇关于Windows 服务未执行 OnStart 入口点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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