Search code examples
c#windowsservice

Windows service timeout at start without internet connection


I wrote a service in C# that performs a bunch of requests to my server in timers. If the internet connection is ok at boot or at the time I start it manually everything works just fine. However, if the connection is not given and the service tries to start, it times out.

I am not a pro regarding Windows services. I tried to fix this by delaying the start type (automatic delyayed) but it does not work either.

Can anyone help me with this problem?


Solution

  • Thanks to everyone who gave me input on this matter. I delayed the actions of the service in the OnStart function and I additionally disable the logic of the service until the internet connection is established. I do not have a problem since