Search code examples
tfsmsbuildexecmsbuild-task

Exec task in msbuild TFS won't execute exe properly


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?


Solution

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