且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows服务将无法重新启动后自动启动

更新时间:2021-10-19 23:25:01

您可能有一个竞争条件与依赖。你可以解决这个通过配置为您服务,对其他服务的依赖可能是补丁(比如TCP / IP),但我真正要做的就是改写为您服务,并不需要启动的临界增长执行路径时进行此调用。它应改为定期尝试做在以后的Web服务调用,并记录有用的信息,或将消息发送到任务栏工具或类似的,如果有一个需要解决的问题。

You likely have a race condition with a dependency. You could probably patch around this by configuring your service to have a dependency on another service ( say tcp/ip ) but what I'd really do is rewrite your service to not need to make this call during the criticial execution path of startup. It should instead periodically attempt to make the webservice call at a later point and log useful messages or send messages to a taskbar utility or similar if there is a problem that needs to be addressed.