“The name 'HTML' does not exist in the current context” in MVC 3 Views

后端 未结 21 2218
野的像风
野的像风 2020-12-15 03:50

I´m starting to use \"MVC 3\" but I´m facing some little problems. In my Views, when I code something like this:

@if(Request.IsAuthenticated) {
    

        
相关标签:
21条回答
  • 2020-12-15 04:07

    In my case my Packages folder was missing including MVC and Razor so I have updated packages in packages.config, reopened the view and it worked.

    0 讨论(0)
  • 2020-12-15 04:07

    Close Visual Studio => Delete the obj and bin folders located in your project => Start Visual Studio

    0 讨论(0)
  • 2020-12-15 04:08

    Maybe I am a bit late to answer this question but this easy fix helped me:

    Right click the file > Exclude from project. Right click the file > Include in project.

    0 讨论(0)
  • 2020-12-15 04:09

    I have solved this issue with the old, good, wise Microsoft default solution: reinstall all the things again.

    Uninstall and Reinstall the Visual Studio 2010 and MVC 3 Framework.

    0 讨论(0)
  • 2020-12-15 04:09

    For me this just seemed to be the fact that I had compiler warnings. Code would still compile and run ok but it was not until I fixed all the build warnings that my Intellisense starting working.

    0 讨论(0)
  • 2020-12-15 04:10

    I had this same issue in MVC 4. None of these solutions worked for me. Instead, in Windows, I went into Control Panel -> Uninstall a program. Select Microsoft ASP.NET MVC 4 in the program list. Click 'Uninstall.' A 'Microsoft ASP.NET MVC 4 Setup' wizard will display. Click 'Repair.'

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