Why does xcopy exit with code 9009 in Visual Studio post-build step?

Viewed 51331

I am getting the following error, which I don't understand. Any suggestions?

Error 1 The command "xcopy "D:\Users\johndoe\Documents\Visual Studio 2008\Projects\MyProject\MyProject.Modules.Ribbon\bin\Debug\MyProject.Modules.Ribbon.dll" "D:\Users\johndoe\Documents\Visual Studio 2008\Projects\MyProject\MyProject\bin\Debug\Modules\" /Y" exited with code 9009. MyProject.Modules.Ribbon

10 Answers

Found my answer: The command had a line break between the source and destination strings. So, Visual Sudio was treating it as two commands. Eliminating the line break solved the problem.

Your xcopy command failed for some reason.

I would guess that either the DLL file doesn't exist (eg, the build failed) or the target path doesn't exist.

Run the same command line in a command prompt and see what error it prints.

Thanks for your help.

I gave complete path of xCopy and it worked for me.

%windir%\system32\xcopy

%windir%\system32\xCopy "$(ProjectDir)app\ExtjsWS\build\*.*" "$(publishUrl)\app\ExtjsWS\build" /y /i/e</PostBuildEvent>

In my case: i fix it do this: Add value %SystemRoot%\system32 to Environmental variable's Path variable,and restart my computer,rebuild the solution,it goes fine.

windows defender was blocking access for me, because I get so many of these silly push notifications I was just ignoring it during the build process. Click the notification and allow access for xcopy. Problem solved

Related