Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Msbuild Visual Studio 2010生成后事件完全被忽略_Msbuild_Visual Studio 2012_Post Build Event - Fatal编程技术网

Msbuild Visual Studio 2010生成后事件完全被忽略

Msbuild Visual Studio 2010生成后事件完全被忽略,msbuild,visual-studio-2012,post-build-event,Msbuild,Visual Studio 2012,Post Build Event,我在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安

我在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 update,但因为我不知道它何时不工作,所以我无法指定它们。我想触发构建后事件,但不管它有多简单,它永远不会被触发。项目配置很好,因为它为我的团队成员(在他们的机器上)工作

为了弄清楚发生了什么,我做了:

  • 创建测试项目
  • 禁用所有插件(CodeMaid、VSAssistX等)
  • 创建了预构建、预链接和后构建事件,这些事件只是回显某些内容(当然在项目属性中启用了它们(在构建中使用->是))
结果是,我看到了关于预构建和预链接构建事件的echos和VS消息,但没有看到关于后构建事件的消息(顺便说一句,我使用的是Qt插件):


1> ----重新生成所有已启动:项目:测试,配置:调试Win32------
1> 构建已开始2013-02-07 11:03:54。
1> _PrepareForClean:
1> 正在删除文件“Debug\Test.lastbuildstate”。
1> 初始化BuildStatus:
1> 由于指定了“AlwaysCreate”,正在创建“Debug\Test.unsuccessfulbuild”。
1> 预构建事件:
1> 预构建
1> 自定义构建:
1> 移动测试。hpp。。。
1> Uic'ing测试。用户界面。。。
1> 碾压混凝土试验。。。
1> RCC:警告:“C:\Projects\BuildEvents\Test\Test\Test.qrc”中没有资源。
1>  
1> CLC编译:
1> moc_Test.cpp
1> main.cpp
1> Test.cpp
1> 正在生成代码。。。
1> qrc_Test.cpp
1> 预链接事件:
1> 预链接
1> qtmaind.lib(qtmain_-win.obj):警告LNK4099:在“qtmaind.lib(qtmain_-win.obj)”或“C:\Projects\BuildEvents\Test\vc100.PDB”中未找到PDB“vc100.PDB”;链接对象,好像没有调试信息
1> Test.vcxproj->C:\Projects\BuildEvents\Test\Test.exe
1> FinalizeBuild状态:
1> 正在删除文件“Debug\Test.unsuccessfulbuild”。
1> 触摸“Debug\Test.lastbuildstate”。
1>
1> 构建成功。
1>
1> 时间流逝00:00:02.80
=========全部重建:1成功,0失败,0跳过==========

我怀疑问题出在Visual Studio本身,但也许您有更好的想法,知道是什么原因导致了这一问题,以及如何解决它?

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

在csproj文件中,RunPostBuildEvent设置为什么?我有同样的问题,只有在使用msbuild.exe启动生成时,才会在VS 2012中忽略预生成事件。


    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 ==========