Razor intellisense error: Feature 'extension method' cannot be used because it is not part of the ISO-2 C# language specification

后端 未结 6 527
粉色の甜心
粉色の甜心 2020-12-02 23:21

Goal:

  • Use cshtml Razor templates to format data
  • Embed cshtml Razor templates in Class Library as Embedded Resources
6条回答
  •  猫巷女王i
    2020-12-02 23:37

    The solution for me was to change the project type

    1.Unload the project

    2.Edit project

    3.Add line below (depending on your project MVC version) right after ProjectGuid

    MVC 4

    {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
    

    MVC 3

    {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
    

    @Matt

    Try adding this to the Web.Config in the Root of the project (not in the Views Folder)

    
    ...
     
        
          
    ...

提交回复
热议问题