Why won't my .Net Windows service start automatically after a reboot?

1

I get the error below in the event log when the computer boots, the service is set to automatically start, when I manually start the service it starts without a problem.

Any ideas?

Service cannot be started. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80010002): Call was canceled by the message filter. (Exception from HRESULT: 0x80010002 (RPC_E_CALL_CANCELED)) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

Thanks

c#
windows-services
asked on Stack Overflow Jun 15, 2009 by (unknown user)

2 Answers

2

Does your service depend on some other component/service that may not have started up yet at machine boot?

answered on Stack Overflow Jun 15, 2009 by Jonas
1

You can fix this by adding a dependency to the Windows Management Instrumentation service (winmgmt.exe).

Please see my answer here: https://stackoverflow.com/a/13454379/1003958

answered on Stack Overflow Nov 19, 2012 by Jonathan Persson • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0