Windows服务错误消息“Windows无法在本地计算机上启动该服务。错误1053:服务未及时响应启动或控制请求“ [英] Windows Service error message "Windows could not start the service on local computer. Error 1053: service didn't respond to start or control request in timely fashion"

查看:257
本文介绍了Windows服务错误消息“Windows无法在本地计算机上启动该服务。错误1053:服务未及时响应启动或控制请求“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在visual studio 2010中创建了一个ASP.net Web应用程序。现在我想将其转换为Windows服务。我怎样才能实现它。





我对Windows服务很新。我想在Windows服务中使用与我的asp.net Web应用程序相同的功能。



它没有任何用户界面。



我在这里简要介绍我的网络应用程序,以便您可以指导我如何在Windows服务中执行此操作。



检索非常来自IMAGE文件夹的大图像,根据特定条件驻留在我的网络应用程序中。



调整图像大小并将其存储到数据库中。

<检索存储在数据库中的已调整大小的图像,并将其存储到名为Large的服务器文件夹中,然后再将该图像调整为3个不同大小,并将其保存到服务器上名为List,Mini,* Thumb *的三个相应大小的文件夹中。



现在我想构建具有相同功能的Windows服务,并且每隔15分钟就会在服务器上运行。



希望现在我更清楚了。请在这方面帮助我。



我的网络应用程序代码工作正常。但是我不知道将这些代码放在我的Windows服务中,因为我对Windows服务很新。



我试图将该代码放在开始时也是oncontinue方法,但那时服务不允许启动。

它给出了错误消息。Windows无法在本地计算机上启动MYWindowService服务。错误1053:服务没有及时响应启动或控制请求此服务无法启动本地机器。



非常感谢您的帮助。



提前致谢。

Hi,

I have created one ASP.net web application in visual studio 2010. Now I want to convert it into windows service. How can i achieve it.


I am very new to windows service. I want same functionality in my windows service as it is in my asp.net web application.

It haven''t any UI.

I am briefing my web application here so according to that you can guide me how to do it in windows service.

Retrieving very Big image from IMAGE folder which resides in my web application according to certain condition.

Resize those image and store it into database.

Retrive resized images stored in database and store it into server folder called Large and again resize that image in 3 more different size and save into their three respective size folders called List, Mini,*Thumb* on server.

Now i want to build windows service with same functionality and it run on server after every 15 mins.

Hope now i am more clear. please help me in this regards.

my web application code is working fine. but i don''t know where to put this code in my windows service as I am very new to windows service.

I tried to put that code onstart and also oncontinue method but at that time service was not allowed to start.
It gives error message."Windows could not start the MYWindowService service on local computer. Error 1053: service didn''t respond to start or control request in timely fashion" this service can not start on your local machine."

Your help is really appreciated.

Thanks in advance.

推荐答案

关于错误消息:此服务无法在本地计算机上启动。

您是否使用Release版本?有时,InstallUtil与Debug一起使用构建,给出此消息。发布版本应该可以正常工作。

参考: http://stackoverflow.com/a / 7611641 [ ^ ]



如果您觉得这很有用,请给它评分..
Regarding error message : "this service can not start on your local machine."
Do you use Release build?. Sometimes, InstallUtil with the Debug build, gives this message. The Release build should work fine.
Ref: http://stackoverflow.com/a/7611641[^]

If you find this useful, rate it..


公共部分类MyNewService:ServiceBase

{

private DirectoryInfo imgDir;
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings [b1]。ConnectionString);

string ImgName;

byte [] rImg;

public MyNewService()

{

InitializeComponent();

}

protected覆盖void OnStart(string [] args)

{

//这里我用两种方式调用线程但是它给出了同样的错误

DoLongRunningStartupWork(); //或//
public partial class MyNewService : ServiceBase
{
private DirectoryInfo imgDir;
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["b1"].ConnectionString);
string ImgName;
byte[] rImg;
public MyNewService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
//Here I am calling thread two ways i am doing but it gives same error
DoLongRunningStartupWork(); //or//
(new Thread(() => DoLongRunningStartupWork()){IsBackground = true}) .Start();





}

void DoLongRunningStartupWork()

{

///此部分包含整个程序代码

}



}
void DoLongRunningStartupWork()
{
/// This part contains whole program code
}


这篇关于Windows服务错误消息“Windows无法在本地计算机上启动该服务。错误1053:服务未及时响应启动或控制请求“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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