mkruer

In one of my scripts, I am copying files for a website from a repository to the finale destination using RoboCopy. However when I run the script RoboCopy exits with error code 1 failing the build process. The thing is this is totaly correct and there is nothing wrong with this. Is there a way around this

F:\Build_Management\Team_Build\TFS Development\TFSBuild.proj(50,3): error MSB3073: The command "robocopy "F:\Build_Management\Team_Build\Help\BetaFiles" "F:\Help\BetaFiles" /V /S /E /MIR /W:5 /R:3 /XF .tmp .bak .old /XD Archive" exited with code 1.
Done building target "AfterDropBuild" in project "TFSBuild.proj" -- FAILED.

Done building project "TFSBuild.proj" -- FAILED.

Build FAILED.
F:\Build_Management\Team_Build\TFS Development\Test Help Build Project\BuildType\TFSBuild.proj(50,3): error MSB3073: The command "F:\Build_Management\Team_Build\Help\BetaFiles" "F:\Help\BetaFiles" /V /S /E /MIR /W:5 /R:3 /XF .tmp .bak .old /XD Archive" exited with code 1.
0 Warning(s)
1 Error(s)

Time Elapsed 00:00:03.35

<PropertyGroup>

<RoboCopySettings>/V /S /E /MIR /W:5 /R:3</RoboCopySettings>

<RoboCopySettingsFilesToExclude>/XF .tmp .bak .old</RoboCopySettingsFilesToExclude>

<RoboCopySettingsFoldersToExclude>/XD Archive</RoboCopySettingsFoldersToExclude>

</PropertyGroup>

<Target Name="AfterDropBuild">

<Message Text="Robocopy Files to Destination Folder" />

<Exec Command="robocopy &#34;$(SolutionRoot)\$(ProjectPath)\BetaFiles&#34; &#34;$(SolutionDestination)\BetaFiles&#34; $(RoboCopySettings) $(RoboCopySettingsFilesToExclude) $(RoboCopySettingsFoldersToExclude)" />

<Exec Command="robocopy &#34;$(SolutionRoot)\$(ProjectPath)\HelpPages&#34; &#34;$(SolutionDestination)\HelpPages&#34; $(RoboCopySettings) $(RoboCopySettingsFilesToExclude) $(RoboCopySettingsFoldersToExclude)" />

<Exec Command="robocopy &#34;$(SolutionRoot)\$(ProjectPath)&#34; &#34;$(SolutionDestination)&#34; /V /W:5 /R:3 /XF Help.sln Help.vssscc " />

</Target>



Re: Team Foundation Server - Build Automation RoboCopy Exits with Error Code 1 causing TFSBuild to Fail

Buck Hodges

It looks like you want to use the IgnoreExitCode property on the Exec task.

http://msdn2.microsoft.com/en-us/library/x8zx72cd.aspx

Buck




Re: Team Foundation Server - Build Automation RoboCopy Exits with Error Code 1 causing TFSBuild to Fail

mkruer

Thanks, i was using ContinueOnError. This works much better.