MSBuild conditional Exec?

前端 未结 3 1317
一向
一向 2021-01-06 13:47

I am building various projects using the

E.g



        
3条回答
  •  不知归路
    2021-01-06 14:05

    If you can add the following to each of your projects:

    
        
    
    

    ... then you only need to add a property:

    
      
    
    

    This works because someone smart at Microsoft added the following line at the end of the CoreCompile target in Microsoft.[CSharp|VisualBasic][.Core].targets (the file name depends on the language and MSBuild/Visual Studio version).

    
    

    So if you specify a target name in the TargetsTriggeredByCompilation property, your target will run if CoreCompile runs-- and your target will not run if CoreCompile is skipped (e.g. because the output assembly is already up-to-date with respect to the code).

提交回复
热议问题