MSBuild VC2012, how to make sure AfterBuild only works when output changes?

I am trying to add an AfterBuild task to my VC ++ 2012 project, which runs only on exit. If I am right, in C #, when you add post-build-event, you have the option to specify when to run post-build-event. I tried to add a condition such as _SourceItemsToCopyToOutputDirectory , but this does not help, it is empty whether I am performing a null assembly or not. The only property I found is LinkSkippedExecution , but I'm not sure if this is the best option.

thanks for the help

+4
source share
1 answer

Check this question and the question: You can create a property in a task before assembly based on the timestamp of the output files.

<Target Name="BeforeBuild"> <PropertyGroup> <MyBeforeCompileTimestamp>%(IntermediateAssembly.ModifiedTime) </MyBeforeCompileTimestamp> </PropertyGroup> </Target> <Target Name="AfterBuild"> <CallTarget Condition="$(MyBeforeCompileTimestamp) != %(IntermediateAssembly.ModifiedTime)" Targets="MyTarget" /> </Target> 
+2
source

All Articles