How to build .csproj with C# 7 code from command line (msbuild)

You'll need to install msbuild-2015 on your CI agent.

https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15

The default install directory for msbuild will be: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe


Having installed Visual Studio 2017 Community Edition, the path to msbuild.exe on my machine is:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe