错误1053:当引入并运行WCF服务时,该服务没有及时响应启动或控制请求



我正试图使用下面的批处理文件安装WCF服务,该服务已成功安装,但在运行时引发错误1053

我试过了,-在注册表编辑器中添加ServicePipeTimeout DWord,-使用sfc/scannow命令检查系统文件是否损坏,-重置网络缓存和配置,-获得应用程序的所有权,-使用Release Build而不是调试。

上述解决方案均未解决错误

这是我在批处理文件中使用的代码

ECHO USAGE:
ECHO        %0 [option]
ECHO        r (or R) to have services installed from "Release" path. Release will also be added to service names. It will install services from debug path if nothing is specified.
ECHO.
ECHO.
SET Mode=Debug
IF "%1"=="R" (SET Mode=Release) 
IF "%1"=="r" (SET Mode=Release)
SET serviceUserName=user1
SET password=password
SET net4Path=%CD%
ECHO Installing Xignite Service
SET servicePath="%~dp0pathtoServiceHost.exe"
SET serviceName=ServiceHostSvc
SC create %serviceName% binPath= %servicePath% DisplayName= "Service1-"%Mode%
SC description %serviceName% "Description here."
SC CONFIG %serviceName% obj= %serviceUserName% password= %password% type= own
ECHO  Service1 Installed
ECHO.
SC START %serviceName%
pause

我还能做些什么来解决这个错误吗?

看起来服务代码的开头可能有一些异常。试着在开始时添加更多的日志,直到执行到达哪里。

最新更新