How to make razor view engine to use c# 6.0

后端 未结 4 1241
盖世英雄少女心
盖世英雄少女心 2020-12-09 14:57

Currently my razor view engine throws and error saying \"Please use language version 6 or higher\". That may just be resharper giving me a pointer. But how do i make razor u

4条回答
  •  没有蜡笔的小新
    2020-12-09 15:02

    Other answers are quite good, but I found a good and short article that definitively clarify the steps for this issue: https://cpratt.co/using-csharp-6-or-7-with-mvc-5/

    In short:

    1. In the Package Manager Console install Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform

    2. checka/alters you Web.config with the following lines at the end:

    
      
        
        
      
    
    

提交回复
热议问题