The same ASP.NET MVC project pulled from GitHub compiles without any errors in my friend's PC but in mine, only in Razor View files (.cshtml) I get multiple errors like:
The name 'ViewBag' does not exist in the current context
The name 'Scripts' does not exist in the current context
The name 'Styles' does not exist in the current context
Since I thought it was regarding config files I deleted and cloned the project but still the same. The project will run fine though. But because of this problem I cannot get proper IntelliSense in development.
Update:
For some weird reason if I change System.Web.Mvc
version to 5.0.0.0
in my PC then errors in View go away.
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
But why?
Any help will be really appreciated.