【发布时间】:2018-05-18 09:02:26
【问题描述】:
我正在尝试使用 vsts 在实验室中创建 wcf 服务。
我创建了一个使用 msbuild 任务工作的构建定义。然后它使用 robocopy 使用 Publish Artifacts 步骤将相关 dll 复制到实验室内的远程目录。
但是,我需要将内容创建为 Windows 服务,并在发布后启动。似乎有些东西正在运行,因为我在成功发布大约 9 分钟后看到了一个创建的日志文件,但我在服务菜单或 IIS 中看不到我的服务。
当我尝试运行执行 sc 创建的 bat 脚本(使用运行脚本步骤)时,我收到 access denied 错误,即使在 vsts 构建定义中我已授予 step 权限来修改环境。
这是完整的错误:
2018-05-17T13:00:13.7702615Z ##[section]Starting: Run script GloBill/InstallBackEnd.bat
2018-05-17T13:00:13.7705444Z ==============================================================================
2018-05-17T13:00:13.7705561Z Task : Batch Script
2018-05-17T13:00:13.7705655Z Description : Run a windows cmd or bat script and optionally allow it to change the environment
2018-05-17T13:00:13.7705748Z Version : 1.1.3
2018-05-17T13:00:13.7705824Z Author : Microsoft Corporation
2018-05-17T13:00:13.7705924Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613733)
2018-05-17T13:00:13.7706023Z ==============================================================================
2018-05-17T13:00:13.7775377Z ##[command]C:\agent\_work\1\s\GloBill\InstallBackEnd.bat
2018-05-17T13:00:13.8030595Z
2018-05-17T13:00:13.8031049Z C:\agent\_work\1\s>sc create GloBillBackEnd ../Services/GloBill.WS.exe
2018-05-17T13:00:13.8048684Z [SC] OpenSCManager FAILED 5:
2018-05-17T13:00:13.8048781Z
2018-05-17T13:00:13.8048901Z Access is denied.
2018-05-17T13:00:13.8048957Z
2018-05-17T13:00:13.8064609Z ##[error]Process completed with exit code 5.
2018-05-17T13:00:13.8073202Z ##[section]Finishing: Run script GloBill/InstallBackEnd.bat
我的想法已经不多了。
【问题讨论】:
-
什么是批处理脚本?你能在这里显示详细的整个构建日志吗?另外,请确保代理机器可以访问您的IIS服务器。
-
什么是构建日志(通过设置
system.debug为true)? -
构建日志中出现上述故障的部分来自日志。
-
嘿,system.debug 是假的。
-
因此您可以将 system.debug 设置为 true 并在此处设置提供程序详细信息构建日志。
标签: msbuild azure-devops publish