Using C# 7 features inside of a View in an ASP.NET MVC Core project
Could you try the following (recommended by folks on the ASP.NET core team):
- Install the Microsoft.CodeAnalysis.CSharp (version 2.0.0) and System.ValueTuple (version 4.3.0) packages
In Startup.cs, in the ConfigureServices method, configure Razor to use C# 7 by doing the following:
services.AddMvc().AddRazorOptions(options => options.ParseOptions = new CSharpParseOptions(LanguageVersion.CSharp7));