且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当VS解决方案中的目标失败时,如何使msbuild失败?

更新时间:2023-02-16 20:57:00

将自定义目标添加到项目的InitialTargets属性.

Add your custom target to the InitialTargets attribute of your project.

InitialTargets ="RunTargetAfterBuild"

InitialTargets="RunTargetAfterBuild"

您是正确的,这不会解决您的问题.但是使用AfterBuild Target,我可以复制并在.sln上获取msbuild失败

You are correct that this will not solve your issue. But using the AfterBuild Target I was able to repro and get msbuild on the .sln to fail