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".
@model xyz.abc.SomeClass
I checked the references, all of them are in place. I added a web.config in view folder, but that didn't fix it.
Is there anything i am missing?
For me this was the issue. This whole block was missing from the section.
It is a horrible mistake but:
Be sure you have Web.config files in your View at Remote. Maybe you skipped to upload it by your Ftp programme's filters.
I ran into this same problem, but in my case, the only thing that had changed is that I had uninstalled Visual Studio 2012 and installed Visual Studio 2013. I opened up our solution, but I kept getting the same
The name 'model' does not exist in current context
error in every Razor view.My coworker suggested checking for updates for VS2013. After I installed the VS2013 Update 1, I stopped getting this error.
Check your config file on views directory. in the add the key for MVC 4/5
Check your web.config file should be exist in published files
I was facing the same issue and then I find a solution. The solution is:
The .suo file is a hidden file in the same folder where the .svn solution file exists. Hope, it'll work!