Alex Rivera | Logout

Why is <Target Name="Build"> not found in any .csproj file?

Asked 2012-11-09T21:43:34.640
11

Just curious - whenever I see xml of .csproj , it starts with DefaultTargets="Build" and hence I assume that <Target Name="Build"> should be present; However, I have never found this default target in any .csproj file.

Does VS inject this target before compilation or does msbuild built it by default. What happens internally?

Edit
Report

1 Answer

6

A csproj typically has this:

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

which according to MSDN also imports Microsoft.Common.targets which is where that target is defined.

answered 2012-11-09T21:52:25.873

Your Answer