title: Run an MSBuild target only if project is actually built
body: <p>I have an MSBuild file that builds *<em>/</em>.sln files (builds all .sln files that exist).</p>
  
  <p>The build uses the <em>Build</em> target, so if no changes were made to input files, no project should be built again.</p>
  
  <p>I would like to execute some custom target <strong>only if</strong> a project actually gets built again.</p>
  
  <p>How can this be done?</p>
  
  <p>Both <strong>AfterBuild</strong> and <strong>AfterCompile</strong> are always called, no matter if the compile/build actually takes place.</p>