Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prebuild event Copy command exits with code 1

I have the following in a prebuild event:

copy /y $(ProjectDir)ThirdPartyAssemblies\ $(TargetDir) 

Which results in the following error:

The command "copy /y C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\myproject\ThirdPartyAssemblies* C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\myproject\bin\Debug\" exited with code 1.

I've tried it in a post build event too and get the same error. Yet when I run the command it results in (the one in the error) in a console window it works fine. What am I doing wrong?

like image 904
Mark Bostleman Avatar asked Apr 08 '12 13:04

Mark Bostleman


1 Answers

I'm not sure if it's related to the error you're receiving, but you need to place quotes around your path/file names since there are spaces in them.

copy /y "C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\myproject\ThirdPartyAssemblies*" "C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\myproject\bin\Debug\"

like image 116
Michael Bowersox Avatar answered Sep 25 '22 20:09

Michael Bowersox