无法从命令行或调试器启动服务.. [英] Cannot start service from a command line or debugger..

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

问题描述





我是Windows服务的新手..



我的问题是我有在VB.NET中创建了一个Windows服务。当我安装并启动服务时它运行正常..



现在我尝试添加一个Schedule Task来根据预定的时间自动启动服务..当Scheduler尝试运行..我收到以下错误..



无法从命令行或调试器启动服务。必须首先使用installutil.exe安装Windows服务然后开始使用服务资源管理器,Windows服务管理工具或NET启动..



我无法找到解决方案。真正希望帮助我解决这个问题的人可以回复..



提前谢谢..

Hi,

I am new to windows service..

My problem is i have created a windows service in VB.NET. When I install and start the service it is running fine..

Now I try to add a Schedule Task to automatically start the service based on scheduled time.. When Scheduler tries to run.. I am receiving following error..

"Cannot start service from command line or debugger.A windows service must first be installed using installutil.exe and then started with service explorer, Windows services administrative tool or NET start..

I am unable to find solution. Those who really wish to help me for solving this problem can reply..

Thank you in advance..

推荐答案

您是否使用INSTALLUTIL安装了服务? ?



从您收到的错误消息中,可能没有,或者安装不成功。
Did you install the service using INSTALLUTIL??

From the error message you got, probably not, or the installation wasn't successful.


服务将启动当计算机重新启动时单独使用。

因此,您无需启动我们的服务任务调度程序。
A service would start by itself when a computer restarts.
As a result, you don't need to start the service using the task scheduler.


我在这里看到一个设计问题,因为Windows服务是为了全天候运行。如果您使用Schedular在特定时间间隔上运行任务,那么您可以简单地开发一个执行所需任务的控制台应用程序,然后结束。这是我的2美分,除非我不理解这些问题。
I see a design issue here as Windows Services are meant for running 24x7. If you are using Schedular to run a task on specific time interval then you can simply develop a console application which performs the required task and then simply ends. That is my 2 cents unless i missunderstood the questions.


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

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