MSBuild is a build system.
Given files and commands, it tries to do the "minimal amount of work"
You can execute csproj files by running msbuild (from your Developer terminal)
Three main parts to a csproj
PropertyGroup - Defines variables
ItemGroup - Defines input files
Target - Defines functions on the input files
Writes "Hello World" to the console.
<Project>
<Target Name="Main">
<Message Text="Hello World" />
</Target>
</Project>
Using a PropertyGroup to define variables
Uses a variable to write "Hello World" to the console.
<Project>
<PropertyGroup>
<MessageToPrint>Hello World</MessageToPrint>
</PropertyGroup>
<Target Name="Main">
<Message Text="$(MessageToPrint)" />
</Target>
</Project>
Using an ItemGroup to define input files
Copies files, but only if they've changed!
<Project>
<ItemGroup>
<MyFile Include="*.txt"></MyFile>
</ItemGroup>
<Target Name="Main">
<Copy SourceFiles="@(MyFile)" DestinationFolder="Output" />
</Target>
</Project>
Using conditions for control flow
Same as above, but optionally delete the target directory before copying.
<Project>
<ItemGroup>
<MyFile Include="*.txt"></MyFile>
</ItemGroup>
<Target Name="Main">
<RemoveDir Condition="'$(Purge)' == 'true'" Directories="Output" />
<Copy SourceFiles="@(MyFile)" DestinationFolder="Output" />
</Target>
</Project>