I tried the following postbuild command in VS to copy all the dlls and other related files into a centralized folder:
robocopy $(TargetDir) $(TargetDir)Bin *.dll *.pdb *.xml /MOVE
It successfully moves them if the Bin folder doesn’t have those files yet. But after the second execution, the files are not moved. I am suspecting that it fails because the files in there already exist. Is there a switch to force overwrite without prompting? I looked at the possible switches for robocopy and can’t really find the one I am looking for.
I’m guessing that Robocopy is refusing to move files that it detects are the same on subsequent runs. You should be able to force it to do so with the /IS (include same) and /IT (include tweaked) flags – i.e.,