Exec task in msbuild TFS won't execute exe properly

怎甘沉沦 提交于 2019-12-11 05:28:52

问题


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 &quot;C:\Program Files (x86)\Cisco Systems\VPN Client\vpnclient.exe&quot; 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?


回答1:


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?




回答2:


I couldn't work this one out. So I used Invoke Process in the XAML template instead. Which has worked fine.



来源:https://stackoverflow.com/questions/6470242/exec-task-in-msbuild-tfs-wont-execute-exe-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!