Target not running when using BeforeTargets=“Build” on Build Server
I have a custom .targets file which I import into my C# MVC web application's project file. I've added custom targets to this like so: <Target Name="CopyFiles" BeforeTargets="Build"></Target> This works fine when building under Visual Studio, but when I use TeamCity to build it, the target never gets run, and I can't work out why. If I change my target to use BeforeTargets="Compile" then it runs. Alternatively, if I add an additional target with the name Build to the .targets file <Target Name="Build" /> then it will run, but doing so overrides the existing Build target and thus my application