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

David Veeneman picture David Veeneman · Jan 1, 2010 · Viewed 49.4k times · Source

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

Answer

Jobrocol picture Jobrocol · Feb 9, 2012

I encounted this error on the TeamCity build server. I finally resolved it after checking the build log and found:

"'xcopy' is not recognized as an internal or external command."

I then changed my statement to:

C:\Windows\System32\xcopy "$(ProjectDir)config\Web.config.$(ConfigurationName)" "$(ProjectDir)Web.config" /Y/R