Windows Service not starting on Windows 10 upgrade

前端 未结 4 2113
既然无缘
既然无缘 2021-02-08 13:05

I wrote a windows service it it works and STARTS fine in most operating systems. I have narrowed down the fact that Windows 10 upgraded from windows 8 causes a problem where th

相关标签:
4条回答
  • 2021-02-08 13:35

    What fixed it for us is, if you can change the service executable yourself:

    In the project file change the Prefer 32-bit flag to false, then reinstall the service.

    Check your service with CorFlags.exe. The 32BITREQ and 32BITPREF should be 0.

    Version   : v4.0.30319
    CLR Header: 2.5
    PE        : PE32
    CorFlags  : 0x1
    ILONLY    : 1
    32BITREQ  : 0
    32BITPREF : 0
    Signed    : 0
    
    0 讨论(0)
  • 2021-02-08 13:40

    We had a similar issue with windows 10 where most .Net based services would fail on startup, but could be started later manually just fine. For some reason, services that are written in .NET take longer to start in Windows 10. By default, if a service takes longer than 30 seconds to start without responding, the service is terminated by Windows.

    I was able to change that behavior to 60 seconds in the registry. Go to:

    HKLM\SYSTEM\CurrentControlSet\Control\

    If it doesn't already exist, create a DWORD (32-bit) key called "ServicesPipeTimeout"(minus quotes). Set its value to 60000(in decimal). This correlates to 60 seconds in milliseconds.

    I even created a regfile to automate this:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control] "ServicesPipeTimeout"=dword:0000ea60

    Just paste into notepad and save as a .reg file.

    This is not a delayed start, but an increase in the time given to services to respond after startup. This fixed the issue for us on multiple machines. Unfortunately, I still do not know why .NET services take so long to start that they get terminated. However, I feel this is a Microsoft bug, and not necessarily anything us users are doing wrong...

    0 讨论(0)
  • 2021-02-08 13:44

    We have a similar issue where one of our services (.net) does not start automatically in some cases after upgrading to Windows 10. Also, in a number of situations the problem was solved after updating to Windows build 10.0.10240; not in every case though. No errors in the event log either.

    Update: a delayed start also seems to work in some cases.

    0 讨论(0)
  • 2021-02-08 13:52

    We also have the same problem with a C++ windows service that we created. Automatic startup works fine for most people. However we have 5 instances now where the customer's service was working fine and now it will not automatically start up.

    The only thing that seems to work is setting to delayed start, but this is not a good option as we would like the service to be started right away. We've also tried adding service dependency of NetLogon - which did not work.

    Also note that this was working fine for customers and at some point (windows update maybe?) it just stopped automatically starting.

    The customers are also able to go into services and start the service manually, and it works. I'll be following this thread and hoping for a better solution than delayed start.

    0 讨论(0)
提交回复
热议问题