I developed a .NET-based .NET service that uses managed parts (C #) and unmanaged code (C / C ++ libraries).
In some domains (for example, the 32-bit Win 2k3 server inside the abc.com domain), the service sometimes takes more than 30 seconds (especially when the OS is rebooted), which prevents the service from starting. I suspect this has something to do with enterprise level security, but I don't know for sure.
http://msdn.microsoft.com/en-us/library/aa720255%28VS.71%29.aspx
I tried the following without success: - delaying the loading of links by moving usage directives as much as possible from the database implementation (in particular, the xml namespace is known to cause delays during loading) - delaying the loading and setting of log4net - preliminary compilation of code with using ngen - delaying the start of the workflow - add / remove manifest + features installed inside - sign / unsign binary files - use configuration settings (there are many settings, and the visibility level for all is set in the app) as late as possible - add all dependencies to the GAC
I have not yet tried to add security requirements for a class that implements the Main method. I did not try to implement my own configuration loader, because after checking the autogenerated code, I noticed that the settings class is single and it gets its instance when called.
By completely removing the log4net dependency, it worked, but this is not an option.
When the network card is disabled, the service starts immediately.
source share