One of the components of my company's product is a Windows service, written in C#. It's dependent on .NET and on a few other libraries, none especially large. It works perfectly when started normally, but doesn't start automatically when the system is booted, even though we configured it to.
This is because there's a thirty second time limit on service startup: if your service takes more than 30 seconds to load, Windows gets bored and kills it. The usual solution is ServiceBase.RequestAdditionalTime(), but that won't help us here: we're getting killed before any of our code even runs, because all our dependencies take so long to load. It's possible to increase this timeout globally by setting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ServicesPipeTimeout, but that's pretty gross. What if someone else is also hitting that setting? What if we don't have the right permissions?
I don't really want to "solve" this in the registry, but it seems like we might have no choice. Is there a better way to approach this problem?