Jan Waga wrote:
Hello,
Is there some way to control SCM timeout while starting or stopping a C#
windows service? I know I can work on a different thread and quickly return
from OnStart(), but I'd like my service to shutdown gracefully, and it takes
a long time to save all data while exiting.
Thanks for any help,
Jan
There is a way in the Win SDK which .NET uses.
Part of the low level API provides a way for your service to HINT to the
SCM.
But .NET does not expose this (and a lot of other useful features!).
If .NET would ALSO expose its internal SCM handle, then you could call
WIN32 directly for the places it falls short.
I'm with you, I think all of this wonderful stuff should be there.
- Lee