MSBuild Target BeforeBuild not executed

It seems that I have a situation where the code that I put in the BeforeBuild target does not execute successfully.

Here is what I have:

<Target Name="BeforeBuild" > <Message Text="Before Build" /> </Target> 

I can not see the output of the message in the assembly log when starting the assembly. Is there something wrong with how Ive formatted this, or should it be in a specific place in the script? Am I even looking in the right place for these posts?

EDIT: changing the value to the maximum doesn't seem to matter

+4
source share
2 answers

See the answer to this question. MS-Build BeforeBuild not starting

You just need to move the BeforeBuild target so that it appears after the line that imports Microsoft.CSharp.targets.

+5
source

You need to override the Before build target correctly. The easiest way to do this is to insert an override before the tag or declare this task as DefaultTargets.

 <Project DefaultTargets="DesktopBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <!-- Override TFS build targets and run custom made ones --> <Target Name="BeforeCompile" DependsOnTargets="VersionAssemblies"></Target> <Target Name="AfterCompile" DependsOnTargets="GetTime;RunTests;CreateHTMLReport;Mail"></Target> <Target Name="AfterDropBuild" DependsOnTargets="RemovePrevContent;CopySrcBinaries;ZipBinPackages;CopyAllContent;RemoveBindings"></Target> </Project> 
0
source

Source: https://habr.com/ru/post/1314064/


All Articles