Recently I build a C# .NET Windows Service, which actually does exactly what it should do. So, no problem there.
BUT... When I start my PC again after a SHUT DOWN (Windows button), and I look immediately in the Services list then I notice every time that my service shows as "running" already. (Only for this purpose I set my service to "delayed start", which gives me a minute or two) All other delayed start services in the list are still NOT running at that moment, as it should be. Obviously my service does NOT work at all in this situation and is completely useless.
However, when I do a Windows RESTART (Windows button), everything works normal and fine. Even when I shut down the PC by pressing the hardware power button for a few seconds, after a power-up everything works just fine.
I tried the same service on my laptop with exactly the same result. This latest is not the only service I made. I tried to build several different services, unfortunately all with the same result.
The service is based on this tutorial: https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer
On both my PC and my laptop I use the latest update of Windows10 and the latest update of Visual Studio 2022.
Anyone maybe noticed a similar behavior? Any help would be greatly appreciated.
Cheers! Peter
P.S. I start to believe this behavior is due to a Windows bug (thanks Bill), since I also noticed that WakeOnLAN after SHUT DOWN (Windows button) randomly reboots the PC several times at night. However when I shut down the PC with the hardware power button it keeps quiet. But that is another issue and doesn't belong here.