msbuild TFS 中的 Exec 任务无法正确执行 exe
我正在使用 Web 部署到远程服务器,我们只能通过 Cisco VPN 客户端进行连接。
在我的 TFS 项目文件中,我有一个 EXEC 任务来打开客户端,然后有一个 EXEC 任务来关闭它。
<Exec Command="start $(COMSPEC) /C "C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe" connect profile user me pwd password" ContinueOnError="false" />
如果没有这些 EXEC 任务,并且如果我手动打开连接,则部署可以正常工作。但这些命令不会在构建中打开客户端,它只是在打开客户端之前挂起此任务。
如果我复制此任务并粘贴到标准构建文件中并从 msbuild.exe 调用该文件,则客户端将打开。
您知道为什么在调用构建时它无法在 TFS 项目中工作,但它可以在单独的构建文件中手动工作吗?
I'm using web deploy to a remote server, through which we can only connect through a Cisco VPN client.
In my TFS project file I have an EXEC task to open the client, then one to close it.
<Exec Command="start $(COMSPEC) /C "C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe" connect profile user me pwd password" ContinueOnError="false" />
Without these EXEC tasks and if I open the connection manually then the deployment works. But these commands aren't opening the client in the build, it just hangs on this task before opening the client.
If I copy this task and paste into a standard build file and call that from msbuild.exe then the client is opened.
Do you know why it won't work in the TFS project when the build is called but it would work manually in a separate build file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了好玩,我会尝试使用 comspec 的完整路径:“C:\Windows\system32\cmd.exe”或您正在使用的操作系统的任何路径,以防它解析不正确。
另外,您是否可以输入 /k 来保持 cmd 提示符打开,并查看假设它正确启动会显示什么错误(如果有)?
For kicks I would try using the full path to comspec: "C:\Windows\system32\cmd.exe" or whatever path for the OS you are using in the off-chance it is resolving incorrectly.
Also, can you toss in a /k to keep the cmd prompt open and see what, if any, errors show assuming it launches correctly?
我无法解决这个问题。所以我在 XAML 模板中使用了 Invoke Process。效果很好。
I couldn't work this one out. So I used Invoke Process in the XAML template instead. Which has worked fine.