Visual Studio 2010后构建事件完全被忽略

3
我在stackoverflow上查找与我的问题类似的内容,但没有找到结果。
It seems that my VS started to completely ignore post-build events. 
Post-build events are not triggered in any project or solution I open
or create using my VS 2010. 

我不知道为什么以及从何时开始出现问题,但几周前之前一切正常。我既没有更改项目配置也没有更改VS安装。然而,有一些Windows更新,但由于我不知道它从何时开始出现问题,因此我无法指定它们。我希望触发后构建事件,但无论多简单,它都不会被触发。项目配置是正确的,因为我的团队成员(在他们的机器上)可以运行。

为了找出发生了什么事情,我做了以下操作:

  • 创建测试项目
  • 禁用所有插件(CodeMaid、VSAssistX等)
  • 创建简单的预构建、预链接和后构建事件,并在项目属性中启用它们(使用构建 -> 是)。

结果是我看到了有关预构建和预链接构建事件的回显和VS消息,但没有关于后构建事件的信息(顺便说一下,我正在使用Qt插件)。



    1>------ Rebuild All started: Project: Test, Configuration: Debug Win32 ------
    1>Build started 2013-02-07 11:03:54.
    1>_PrepareForClean:
    1>  Deleting file "Debug\Test.lastbuildstate".
    1>InitializeBuildStatus:
    1>  Creating "Debug\Test.unsuccessfulbuild" because "AlwaysCreate" was specified.
    1>PreBuildEvent:
    1>  prebuild
    1>CustomBuild:
    1>  Moc'ing Test.hpp...
    1>  Uic'ing Test.ui...
    1>  Rcc'ing Test.qrc...
    1>RCC : warning : No resources in 'C:\Projects\BuildEvents\Test\Test\Test.qrc'.
    1>  
    1>ClCompile:
    1>  moc_Test.cpp
    1>  main.cpp
    1>  Test.cpp
    1>  Generating Code...
    1>  qrc_Test.cpp
    1>PreLinkEvent:
    1>  prelink
    1>qtmaind.lib(qtmain_win.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'qtmaind.lib(qtmain_win.obj)' or at 'C:\Projects\BuildEvents\Test\vc100.pdb'; linking object as if no debug info
    1>  Test.vcxproj -> C:\Projects\BuildEvents\Test\Test.exe
    1>FinalizeBuildStatus:
    1>  Deleting file "Debug\Test.unsuccessfulbuild".
    1>  Touching "Debug\Test.lastbuildstate".
    1>
    1>Build succeeded.
    1>
    1>Time Elapsed 00:00:02.80
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

我怀疑问题出在Visual Studio本身,但也许你有更好的想法,可以解释一下是什么原因导致这个问题,以及如何解决?


你的csproj文件中RunPostBuildEvent设置为什么? - allen
只有在使用msbuild.exe启动构建时,我才会遇到VS 2012中忽略预构建事件的相同问题。 - Ray Cheng
1个回答

0

最后,我只是创建了一个脚本,在每次构建后手动运行。这是愚蠢的解决方案,因为当我的任何团队成员进行需要更改后构建的更改时,我也需要更改我的脚本。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接