To use the new C# 7.1 language features with Visual Studio 2017, you add the setting latest to your project file(s).
latest
We discovered that our MVC projects were triggering this issue.
To fix, we updated the Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package used by these projects from version 1.0.0 to 1.0.7.
Microsoft.CodeDom.Providers.DotNetCompilerPlatform