How to make Windows Service start as “Automatic (Delayed Start)”

后端 未结 4 1189
误落风尘
误落风尘 2020-12-10 10:46

Scenario:

A WCF service running as a Windows Service. Account is \"User\".


What is done:

I have overridden th

4条回答
  •  醉话见心
    2020-12-10 11:22

    Your only other option is to use P/invoke to call ChangeServiceConfig2 with SERVICE_CONFIG_DELAYED_AUTO_START_INFO. But since you seem to be unwilling to add the registry entry, I doubt you would want to use P/invoke. There's no other way to do it from the .NET Framework (< 4.0).

提交回复
热议问题