The name 'model' does not exist in current context in MVC3

后端 未结 20 2169
-上瘾入骨i
-上瘾入骨i 2020-11-29 02:53

I added a cshtml page in an project. When I tried to add the following declaration to it, I get an error: \"The name \'model\' does not exist in current context\".



        
相关标签:
20条回答
  • 2020-11-29 03:20

    I was missing web.config under Areas/MyArea/Views/web.config. Once added it worked fine. This was with MVC 5 and .NET4.5

    0 讨论(0)
  • 2020-11-29 03:20

    I was facing the same issue and then I find a solution. The solution is:

    1. Close Visual Studio
    2. Delete the SUO file
    3. Restart Visual Studio

    The .suo file is a hidden file in the same folder where the .svn solution file exists. Hope, it'll work!

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