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

c#, msbuild, visual-studio

Solution

Near the bottom of the file you'll see this; `<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />` which imports the standard targets, "Build" is one of these. The import generates the "Build" target in a dynamic fashion based on the other data available in the your project file.

Problem

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?

Original source