When you build a project with MSBUILD Tools 2017 and getting that error, you probably need to update your MSBUILD Tools components.
Download the latest version of MSBUILD tools from https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017, run it, choose Modify and then select “Web development build tools” and “.NET Core build tools”.
If you are getting error CS8107: Feature ‘default literal’ is not available in C# 7.0. Please use language version 7.1 or greater.
error CS8107: Feature ‘leading digit separator’ is not available in C# 7.0. Please use language version 7.2 or greater.
You probably need to add <LangVersion>7.2</LangVersion> to your project file(s). Make sure to add it to both debug and release configuration. It’s likely that you will run your server builds on release, so that’s needed.