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.


Felipe · December 20, 2017 at 9:25 pm

Thanks for this, save my day!

Felix Rabinovich · December 23, 2017 at 5:22 am

Unfortunately, didn’t help. Even after adding 7.2 to release I still can’t publish Web Application. Interesting note – that Console application doesn’t have this problem!

    vimvq1987 · December 23, 2017 at 11:59 am

    @Felix: which error were you getting?

Patrick · February 12, 2018 at 12:41 pm

Didn’t work… My solution builds perfect on my Visual Studio 2017 but on my BuildAgent it always show the “GetReferenceNearestTargetFrameworkTask” task was not found … error. I did install all the tools from vs_build tools… I actually need an offline installer… but that part did work, but did not solve the problem

Leave a Reply

%d bloggers like this: