I have an MVC 5 application, made from the empty template. I\'ve added Microsoft.AspNet.Mvc
via Nuget and my packages file looks like so:
I encountered this issue and tried every solution under the sun. For a week I tried editing the web config (in both the view and the root), reloading the project, clearing resharper caches.. you name it, I tried it. I loaded up an old project and hovered over the "Layout" and "Model" sections to see what namespaces they required. On closer examination, the namespaces which were required had been removed from my project. I have no idea how - I had recently performed an upgrade.. Anyhow - I referenced these 2 files from the solution folder System.Web.Mvc and another, rebuilt, and it worked. I could have danced on the spot. Hope this helps someone down the line!