7

I am opening the same MVC solution in VS2013 and VS2015RC, exact same code, but my VS2015RC tells me there are bunch of errors on my .cshtml pages where as VS2013 says no errors. The main problem is I don't get any intellisense because of the errors in VS2015.

What could be causing this? Also, when I Build the solution in VS2015, it says it succeeded? Code snippet:

<!DOCTYPE html>

<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-2.1.3.min.js")" type="text/javascript"></script>
    <meta name="description" content="The description of my page" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
    <div id="header">
        <div class="title">ABC</div>
    </div>
    <div id="categories">
        @{ Html.RenderAction("Menu", "Navigation"); }
    </div>
    <div id="content">
        @RenderBody()
    </div>
</body>
</html>

vs2013enter image description here vs2015enter image description here

haku
  • 4,105
  • 7
  • 38
  • 63
  • Not sure about this one, but I had similar troubles with Razor. I had to delete all references and readd them via nuget. Maybe this will work too – Matt Jul 05 '15 at 21:33
  • This positively reeks of dll incompatibility; check [System.Web.Mvc] because that's where ViewBag is defined. – Liz Jul 07 '15 at 06:41
  • possible duplicate ? http://stackoverflow.com/questions/15550899/the-name-viewbag-does-not-exist-in-the-current-context – Bellash Jul 08 '15 at 09:16

1 Answers1

6

try add this line inside each .cshtml

@inherits System.Web.Mvc.WebViewPage<dynamic>
liujialiang
  • 61
  • 1
  • 3