views:

14

answers:

0

I have some post build events in my project that copy files. The file copies are vital to my project working properly. I want those post build events to raise build errors if anything goes wrong.

While testing a failure scenario, I found that failed copy commands are not raising errors. I do see warnings in the output window but no errors are reported. I have the "Treat warnings as errors" set to "all" in my project. Here is the post build event I want to raise errors:

copy C:\<some invalid path here>\*.* $(TargetDir)\ /Y

I am probably not understanding something. Can someone please tell me how I can make a failed post build copy command raise an error. Thanks.