1

I want to execute a target before project builds.

I have define the following in the .vcxproj file.

  <Target Name="BeforeBuild">
   <Message Text="BeforeBuilds" />
   <CallTarget Targets="myTarget" />
  </Target>

<Import Project="..\GetCat.targets" />
 <Target Name="DefaultBeforeTarget" BeforeTargets="Default">
  <CallTarget Targets="myTarget" />
 </Target>

<Target Name="myTarget" Inputs="$(TargetPath)"  Outputs="$(TargetDir)$(TargetName).tlb" DependsOnTargets="GetCat">
<Message Text="Calling myTarget" />
<Exec Command="mkdri HelloW" />
</Target>

The myTarget <Message> is not getting called.

How to fix this?

RayOldProf
  • 1,040
  • 4
  • 16
  • 40
  • Your question title is about BeforeCompile, but your code uses BeforeBuild. Please clarify what you want to do, and also provide a minimal working sample to reproduce the issue (e.g. we don't know what GetCat.targets contains, or what GetCat does, but that might not even be relevant to the question) – stijn May 13 '16 at 06:48
  • 1
    Did you read this? http://stackoverflow.com/questions/13727351/what-happened-to-beforebuild-and-other-targets-in-vs2012 – stijn May 14 '16 at 12:17

0 Answers0