Hi guys,
this is a strange issue only with Windows 10.
A windows service developed for testing in vb.net doesn’t start under Windows 10 at boot time when set to Automatic start.
The point is, this service does almost nothing – it’s just a pure pretty empty test code.
When start manually it takes less than 100ms.
When started on boot, there are two error entries within the event Viewer:
- Source: Service Control Manager – Event ID: 7009 (A timeout was reached (30000 milliseconds) while waiting for the EVPTestService service
to connect.)
- Source: Service Control Manager – Event ID: 7000 (The EVPTestService service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion.)
Now, started manually, again this only takes around 100ms.
Dev Tool: VS 2010 Prof. SP1
Compiler: set to ANY CODE
Framework: .NET 3.5
Windows 10 Enterprise: Version 1511 Build 10586. 104
The code is not signed
Here is the entire own test code:
Imports System.Threading
Imports System.IO
PublicClassEVPTestService
Shared OnStartEntered
AsDateTime
Shared ThreadCreated
AsDateTime
ProtectedOverridesSub OnStart(ByVal args()AsString)
OnStartEntered = Date.UtcNow
Dim Starter AsNewThread(AddressOf StarterJob)
ThreadCreated = Date.UtcNow
Starter.Start()
EndSub
PrivateSub StarterJob()
Try
Dim JobEntered AsDateTime = Date.UtcNow
Using sw AsStreamWriter = NewStreamWriter("c:\service_test_file.txt",True)
sw.WriteLine("-------------------------------------------------------------")
sw.WriteLine("Service Code Entered: {0} ", myServiceEnteredTimeStamp.ToLocalTime.ToString("MM/dd/yyyy HH:mm:ss.fff tt"))
Dim diff1AsTimeSpan = OnStartEntered.Subtract(myServiceEnteredTimeStamp)
sw.WriteLine("OnStart Entered after: {0} ms ({1} seconds)", diff1.TotalMilliseconds.ToString, diff1.TotalSeconds.ToString)
sw.WriteLine("Thread created after: {0} ms", ThreadCreated.Subtract(OnStartEntered).TotalMilliseconds.ToString)
sw.WriteLine("JOB entered after: {0} ms", JobEntered.Subtract(ThreadCreated).TotalMilliseconds.ToString)
Dim diff2 AsTimeSpan = Now.Subtract(myServiceEnteredTimeStamp.ToLocalTime)
sw.WriteLine("Done! Total Duration: {0} ms ({1} seconds)", diff2.TotalMilliseconds.ToString, diff2.TotalSeconds.ToString)
sw.Flush()
sw.Close()
EndUsing
Catch ex AsException
EndTry
EndSub
EndClass
After hundreds of test the fact is that this code works without any problems under Windows XP, Vista, 7, Windows 8.1. It just doesn’t work in Windows 10!!!
After it always failed in Windows 10, I’ve added the Registry Key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ ServicesPipeTimeout with a value of 12000
Then the service started correctly. I deleted the registry key again and changed the start mode from Automatic to Automatic (Delayed) – and it also started correctly. BUT, these aren’t acceptable options for our customers
production systems - PLEASE KEEP THIS IN MIND!!!. So the questions is, why does this service time out under Windows 10, but works in all other windows versions ???
Here is the file the service produced when it started:
-------------------------------------------------------------
Service Code Entered: 02.12.2016 21:48:27.099
OnStart Entered after: 4577.938 ms (4.6 seconds)
Thread created after: 93.4824 ms
JOB entered after: 1250.1962 ms
Done! Total Duration: 6421.6304 ms (6.4 seconds)
I was checking the boot log (procmon) - see the results in the screenshot:
![Procmon boot]()
So I guess the key question is: why does this dll take so long to load !on Windows 10 only! and how can this be optimized?
This is a serious issue as more and more customers evaluate Windows 10 - and so I really hope some Win 10 expert from Microsoft will take this serious and give us an idea about this problem.
Thanks!