简体   繁体   English

TFS - 构建自动化 InvokeProcess 问题

[英]TFS - Build Automation InvokeProcess issue

I have automation build setup in TFS which is using InvokeProcess step.我在使用 InvokeProcess 步骤的 TFS 中有自动化构建设置。 In this step, I am running a batch(*.bat) file which internally starts IISExpress.在这一步中,我正在运行一个内部启动 IISExpress 的批处理 (*.bat) 文件。

My TFS build is running and it is starting IISExpress without any problem but this build is not going to the next step and it is waiting for the exit code or response from the batch file.我的 TFS 构建正在运行,它正在启动 IISExpress 没有任何问题,但此构建不会进入下一步,它正在等待退出代码或批处理文件的响应。 How to override this functionalty as TFS build shouldn't wait for the result from the batch file and it should continue running the next steps.如何覆盖此功能,因为 TFS 构建不应该等待批处理文件的结果,它应该继续运行后续步骤。

I have configured the result of the InvokeProcess to take from an integer variable ie1 but still it is waiting for some result to be sent back.我已将 InvokeProcess 的结果配置为从 integer 变量 ie1 中获取,但它仍在等待某些结果被发回。

My batch file consists the following code to start IISExpress我的批处理文件包含以下代码来启动 IISExpress

CD C:\Program Files\IIS Express iisexpress /config:C:\Users\ab\Documents\IISExpress\config\applicationhost.config /site:CloudWebRole CD C:\Program Files\IIS Express iisexpress /config:C:\Users\ab\Documents\IISExpress\config\applicationhost.config /site:CloudWebRole

(CloudWebRole is a website) (CloudWebRole 是一个网站)

Any help would be appreciated.任何帮助,将不胜感激。

Thanks,谢谢,

Prav真理

Option-1: you can use following command in your batch file.选项 1:您可以在批处理文件中使用以下命令。

start iisexpress /config:C:\Users\a.b\Documents\IISExpress\config\applicationhost.config /site:CloudWebRole

one thing to note is, it would popup a iisexpress.exe console window.需要注意的一点是,它会弹出一个 iisexpress.exe 控制台 window。

Option-2: If don't want to see the popup console window, write a simple managed wrapper program (say iisexpresswrapper.exe) which just launches iisexpress.exe with the given arguments in the background and returns immediately.选项 2:如果不想看到弹出控制台 window,请编写一个简单的托管包装程序(例如 iisexpresswrapper.exe),它只需在后台使用给定的 arguments 启动 iisexpress.exe 并立即返回。

Well, I think that you didn't need this anymore, but I faced the same problem today and find a solution:好吧,我认为您不再需要这个了,但是我今天遇到了同样的问题并找到了解决方案:

  1. Create a Parallel创建平行
  2. Create a variable on Parallel (BuildFinished, in the picture) and fill the CompletionCondition of the Parallel在Parallel上创建一个变量(BuildFinished,图中)并填充Parallel的CompletionCondition
  3. Assign True to BuildFinished in the build process' finally最后在构建过程中将 True 分配给 BuildFinished'

Like this:像这样:

TFBUILD

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM