I need to delay the 30 second timeout when restarting a .Net 1.1 service. Due to logistical reasons, I can not upgrade to .Net 2.0 to take advantage of the ServiceBase.RequestAdditionalTime() method.
One work-around is to call SetServiceStatus at the beginning of the code. However, for dependency purposes I need all of my code to execute before this is set.
I also looked into setting the registry key ServicesPipeTimeout, but would really prefer not to make a global change for all services since I don’t know what impact that might have.
Is there any equivalent to calling the ServiceBase.RequestAdditionalTime() method in .Net 1.1?
If you look at the source code of the ServiceBase.RequestAdditionalTime method in .NET 2.0 (using a decompiler tool like ILSpy), you’ll see that it’s conceptually doing two things:
dwWaitHintfield of the SERVICE_STATUS structureYou could implement the same functionality in .NET 1.1 using P/Invoke to interact with the Win32 API.