Compile errors when using C# 7 features in new VS Studio 2017 ASP.NET MVC 5.2.3 project

后端 未结 1 750
南方客
南方客 2021-01-05 12:57

I\'m using VS 2017 usually for console applications. But now I have to create a new ASP.NET MVC project and found something curious.

Auto generation of getter and s

相关标签:
1条回答
  • 2021-01-05 13:48

    Thanks to Panagiotis and Tetsuya. It was the version of c#.

    As a reference to this question, you have to do three things:

    1. Uninstall "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" via Nuget Package Manager and reinstall the newest version (currently the 1.0.4)
    2. After this, update Microsoft.Net.Compilers to the newest version (currently 2.2.0)
    3. Change the c# language via project "properties < build < advanced" to version 7.

    done.

    0 讨论(0)
提交回复
热议问题