Can you prevent MSBuild.exe from running Build Events?

后端 未结 9 1911
我在风中等你
我在风中等你 2020-12-08 00:11

I\'m building a number of projects via a script, and the occasional use of custom build events causes a great deal of difficulty for the build system. If it is possible, I\

9条回答
  •  死守一世寂寞
    2020-12-08 00:33

    It seems that the answer is different depending on the project type.

    For C/C++ projects (.vcxproj), you can suppress the PostBuildEvent on the command line with /p:PostBuildEventUseInBuild=false, as AndreiM suggests.

    (Setting /p:PostBuildEvent to an empty string doesn't work for C++ projects, and I can't find any other way to override the post-build command).

    For C# projects (.csproj), you can suppress the PostBuildEvent on the command line with /p:PostBuildEvent=, as most other responders suggest.

提交回复
热议问题