Robocopy outputs 1 upon success, unlike most programs that exit with 0 on success. Visual Studio (and MSBUILD) interprets exit code of 1 as an error.
How can Robocopy b
I found that it's much easier to start robocopy rather than trying to call it in-line with Visual Studio. This way Visual Studio doesn't care about the return code from robocopy.
start robocopy . ..\latestbuild
The only difference I could see is that you will see a command prompt appear and disappear to execute the robocopy command.
Using call instead of start actually doesn't open the command prompt and, even better, redirects the output from the robocopy to Visual Studio output window.
call robocopy . ..\latestbuild
For some reason this approach only works when used in Pre-build events command line.