Windows service install and startup error 1053: the service did not respond to the startup or control request in time (example code)

brief introduction    This article mainly introduces the windows service installation startup error 1053: the service does not respond to the startup or control request in time (sample code) and relevant experience and skills. The article has about 1200 words, 802 views and 9 likes. It is worth recommending!

1 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
2 
3 </configuration>

A c# language windows service is developed with. Net. In the local and test environment, the installation and startup are normal. An error is reported in the new online environment, unable to start – Report – error 1053: the service does not respond to the startup or control request in time.

Later found online. Net framework   v4.0.30128

The local is. Net framework   Microsoft.NET\Framework\v4.0.30319

Add such code in app.config

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>

When it starts, it’s no problem.

On windows2016, version = v4.7.2 can’t, I don’t know why? Just change it to the one above.

Similar Posts: