0

I’m trying to copy a dll compiled file from the ‘Output path’ using post-build event in Visual Studio with xcopy.

When I set the output path to be on the same hard drive as the project itself, the path changes itself to a relative path (“........\abc”), and the post build event fails with exit code 4.

When I set the output path to be on a different hard drive than the project, the path is not changing to a relative path (of course) and the post build event passes successfully.

This is the command:

xcopy.exe $(OutDir)$(TargetName)$(TargetExt) $(SomeFolder)\aa\bb

$SomeFolder is defined in the csproj file of the project.

I need to make it work with a relative path, how can I do it?

Thanks

user3364652
  • 480
  • 8
  • 23
  • if the $(OutDir) or $(SomeFolder) has spaces in ther name, then wrap these in double quotes, refer http://stackoverflow.com/questions/5626557/what-is-going-wrong-when-visual-studio-tells-me-xcopy-exited-with-code-4 for more details – Anil Mar 20 '17 at 07:27
  • No spaces but tried it anyway, same result – user3364652 Mar 20 '17 at 07:42
  • I opened the Output window, the specific error is "Invalid drive specification". Can't it identify relative paths? – user3364652 Mar 20 '17 at 07:46

0 Answers0