Razor Syntax gives errors in View before compiling (No intellisense)

后端 未结 2 999
花落未央
花落未央 2021-01-11 18:20

I was going through the list of NuGet Packages and I was updating everything things like bootstrap, jQuery, etc. but while I was doing that, I unthinkingly updated M

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 18:48

    After days of searching, I finally found this page: MVC Razor view Intellisense broken in VS 2013/2015/2017

    In my Views > Web.Config file I found this code:

     
        
        
          
            
            
            
            
            
            
            
          
        
      
    

    Which, as you can see, has the wrong version of MVC on it. I had previously only checking the tags for the proper version of RAZOR but I neglected the fact that MVC also needs the proper version. Switching the version to:

    
    

    Solved my problem. This reminds me to always look over my code VERY carefully.

    NOTE: As you can see in the question, the version says 5.0.0, and this one says 4.0.0. Different Web.Config files in my different view folders all had different versions written down. Extremely weird.

提交回复
热议问题