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?
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.