Build Events 执行copy 命令路径限制

编写项目Build Events的Pre-build、Post-build时如果使用copy命令必须为绝对路径,比如预定义宏OutDir,编写如下命令:

copy "$(SolutionDir)BuildLibrary" "$(OutDir)"

得到exit code 1的提示,因为$(OutDir)返回相对路径,比如:“Bin\Debug\”。相对路径无法成功执行,只需要修改为如下命令:

copy "$(SolutionDir)BuildLibrary" "$(TargetDir)"
posted @ 2012-09-22 00:15  junchu25  阅读(408)  评论(0编辑  收藏  举报