7

We ran into a problem with integrating MSBuild with PsExec. In our scenario, we run PsExec within a msbuild build file. The PsExec command runs another MSBuild file on a remote server to perform a task which we'd like to see its output on ourside.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
....
<Exec  
    Command="$(PsExecPath) \\$(RemoteIP) -u $(Username) -p $(Password) -w $(RemoteWorkingDir) msbuild.exe fullbuild.xml /t:Release" >
</Exec> 

It works fine and it does not hang, but the output of the remote msbuild command is not appearing on the console. When I run the psexec directly from the command line, it works fine and the remote build output shows up on the screen.

We are using PsExec 2.11 and MSBuild 4.0. What am I missing here?

Houman
  • 1,381
  • 1
  • 8
  • 10
  • similar report here: https://connect.microsoft.com/VisualStudio/feedback/details/810440/psexec-hangs-inside-of-msbuild-with-msbuild-4 – stijn Sep 03 '14 at 18:56
  • Thanks, but my issue is different, in my case it does not hang. I can see the exit code at the end of the process. I would like to see the remote command output on my local command line. – Houman Sep 03 '14 at 23:38
  • 1
    Please read the entire link, especially near the bottom where it says the output is missing *As you can see, MSBuild still swallows/truncates the output of PSExec (even though it no longer hangs with PSExec 2.11).* – stijn Sep 04 '14 at 07:00
  • @stijn Thanks again for your kind reply. I read it all this time. It's peculiar, apparently there's no solution around. Hopefully the next version of PsExec will fix it. – Houman Sep 04 '14 at 09:02
  • yes I know, I tried a couple of things like piping to a file etc but nothing seems to work. If you really need full output, you could use a cygwin ssh server and putty on the client side. – stijn Sep 04 '14 at 09:25
  • have you tried redirecting output into a file on disc and then reading this file and printing using task? – Isantipov May 12 '15 at 22:34

0 Answers0