简体   繁体   English

服务错误1053:无法及时启动

[英]Service Error 1053: Could not start in timely fashion

Before you ask, yes I searched and searched on this issue, tried what others had work for them and came up with nothing. 在您问之前,是的,我搜索并搜索了这个问题,尝试了其他人为他们所做的工作,却一无所获。 I have tried: 我努力了:

  • Running in release mode 在发布模式下运行
  • Running on LocalSystem, LocalService, and named account 在LocalSystem,LocalService和命名帐户上运行
  • I have no debug code in my project 我的项目中没有调试代码

The summary of my project is a Windows service that scans for files in a source folder and at a set time, converts them and places them in a destination folder. 我的项目摘要是一项Windows服务,该服务扫描源文件夹中的文件,并在设定的时间对其进行转换,然后将其放置在目标文件夹中。 These settings can be changed in a GUI which changes an XML file which the service scans periodically. 可以在GUI中更改这些设置,该GUI会更改服务定期扫描的XML文件。

The finished product is wrapped in InstallShield. 成品包装在InstallShield中。 Everything works from VisualStudio. 一切都可以从VisualStudio运行。 I can install the program and the service works perfectly . 我可以安装该程序,并且该服务可以正常运行 When I take my release build and install it myself on the same machine, I get this 1053 error. 当我使用发布版本并将其自己安装在同一台计算机上时,出现此1053错误。

Here is my OnStart 这是我的OnStart

    protected override void OnStart(string[] args)
    {
        // Update the service state to Start Pending.
        ServiceStatus serviceStatus = new ServiceStatus();
        serviceStatus.dwCurrentState = ServiceState.SERVICE_START_PENDING;
        serviceStatus.dwWaitHint = 100000;
        SetServiceStatus( this.ServiceHandle, ref serviceStatus );

        // Set up a timer to trigger every 30s
        System.Threading.Thread t1 = new System.Threading.Thread( new System.Threading.ThreadStart( this.InitTimer ) );
        t1.Start();

        // Set folders and time from xml
        System.Threading.Thread t2 = new System.Threading.Thread( new System.Threading.ThreadStart( this.InitSettings ) );
        t2.Start();

        // Update the service state to Running.
        eventLog1.WriteEntry( "Service successfully started", EventLogEntryType.Information, eventId++ );
        serviceStatus.dwCurrentState = ServiceState.SERVICE_RUNNING;
        SetServiceStatus( this.ServiceHandle, ref serviceStatus );
    }

Here is my main 这是我的主要

    public WTVService(string[] args)
    {
        InitializeComponent();
        string eventSourceName = "Searcher";
        string logName = "WTVConverter";
        if ( args.Count() > 0 )
        {
            eventSourceName = args[0];
        }
        if ( args.Count() > 1 )
        {
            logName = args[1];
        }
        eventLog1 = new EventLog();
        if ( !EventLog.SourceExists( eventSourceName ) )
        {
            EventLog.CreateEventSource( eventSourceName, logName );
        }
        eventLog1.Source = eventSourceName; eventLog1.Log = logName;
    }

Let me know what other info might be helpful. 让我知道其他信息可能会有帮助。

Edit: Also, if it makes a difference, the error comes up instantly, not after the supposed 30 second timeout rule. 编辑:另外,如果有所不同,则错误会立即出现,而不是在假定的30秒超时规则之后出现。

So this is interesting. 所以这很有趣。 I'm sure the InstallShield crowd is kind of limited here, but this might help someone. 我确定InstallShield人群在这里受到一定限制,但这可能会对某人有所帮助。 What ended up working was changing the build mode from SingleImage to DVD-5 . 最终的工作是将构建模式从SingleImage更改为DVD-5 I could not say why, but it now works perfectly. 我不能说为什么,但是现在可以正常使用了。 I tested on a machine that had never before run my program and it all worked. 我在一台从未运行过程序的机器上进行了测试,并且一切正常。

When you are deploying any service through InstallShield you need to either select LocalSystem username or the Admin user credentials. 通过InstallShield部署任何服务时,需要选择LocalSystem用户名或Admin用户凭据。

For execution of any windows service, it requires Admin user or LocalSystem user. 要执行任何Windows服务,它需要Admin用户或LocalSystem用户。

So there is provision of user credentials fr a servive in InstallShield. 因此在InstallShield中提供了用户凭证。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误 1053 服务没有及时响应启动或控制请求 - Error 1053 the service did not respond to the start or control request in a timely fashion 错误1053:服务未及时响应启动或控制请求 - Error 1053: the service did not respond to the start or control request in a timely fashion Windows服务无法启动'错误1053:服务未及时响应启动或控制请求' - Windows Service won't start 'Error 1053: The service did not respond to the start or control request in timely fashion' 启动服务:“错误1053:服务未及时响应启动或控制请求” - Starting a service: “Error 1053: The service did not respond to the start or control request in a timely fashion” 错误 1053:安装并运行 WCF 服务时,服务未及时响应启动或控制请求 - Error 1053: The service did not respond to the start or control request in a timely fashion, when intalled and ran a WCF service C#错误1053,服务未及时响应启动或控制请求 - C# Error 1053 the service did not respond to the start or control request in a timely fashion 发生错误1053,服务未及时响应启动或控制请求 - Im getting Error 1053 the service did not respond to the start or control request in a timely fashion 错误 1053:服务没有使用 FileSystemWatcher 及时响应启动或控制请求 - Error 1053:The service did not respond to start or control request in timely fashion with FileSystemWatcher 1053 windows服务没有及时响应 - 1053 windows service did not respond in timely fashion 安装Windows服务时出错 - 服务未及时响应启动或控制请求 - Error installing Windows service — The service did not respond to the start or control request in a timely fashion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM