我对后期构建事件不是很熟悉,所以我对我的程序出了什么问题感到有些困惑.在visual studio 2010中编译时,我得到以下内容:
The command "xcopy C:\Users\Me\Path\Foo.bar\Library\dsoframer.ocx C:\Users\Me\Path\Foo.bar\bin\Debug\ /Y /E /D
xcopy C:\Users\Me\Path\Foo.bar\ApplicationFiles C:\Users\Me\Path\Foo.bar\bin\Debug\ /Y /E /D
xcopy C:\Users\Me\Path\url\ C:\Users\Me\Path\Foo.bar\bin\Debug\ /Y /E /D
rmdir /S /Q C:\Users\Me\Path\Foo.bar\bin\Debug\.gwt-tmp" exited with code 4.
Run Code Online (Sandbox Code Playgroud)
尽管有这个错误,该程序似乎运行良好,但我不想忽略这个问题,希望没有什么不好的事情发生.奇怪的是,这一行最初只是一个命令(第一个xcopy),但随着我继续编译项目(修复其他问题,主要是引用),错误信息扩大得越来越大.知道会发生什么吗?
编辑:以下是似乎失败的postbuild事件 -
xcopy $(ProjectDir)Library\dsoframer.ocx $(TargetDir) /Y /E /D
xcopy $(ProjectDir)ApplicationFiles $(TargetDir) /Y /E /D
xcopy $(SolutionDir)com.myUrl.gwt\www $(TargetDir) /Y /E /D
rmdir /S /Q $(TargetDir).gwt-tmp
Run Code Online (Sandbox Code Playgroud) 我正在通过脚本构建许多项目,偶尔使用自定义构建事件会给构建系统带来很大的困难.如果可能的话,我想调用MSBuild.exe,以阻止任何构建事件的执行.从长远来看,这不是构建自动化的问题 - 具有构建事件的项目的提交者被预先警告,这样的破坏是违反规则的.
简而言之,有没有办法调用MSBuild来阻止执行任何自定义构建步骤(如果存在)?
更新:
我考虑过对项目文件进行就地(自动)编辑,但是对于三个事件中的每一个,我更喜欢命令行等效于将"Excluded From Build"(参见Build Events选项)设置为Yes.