title: MVC Razor view Intellisense broken in VS 2013/2015/2017
body: <p>I have an existing project written in VS2010 which when loaded in VS2010 works perfectly.</p>
  
  <p>When I load this same project in VS2013 the MVC Razor views contain lots of errors as if the config file is missing from the views folder. </p>
  
  <p>It appears to have not loaded the Razor editor correctly using the config files from both the root and the views folder and instead gives me errors like ...</p>
  
  <pre><code>The name 'model' does not exist in the current context
  </code></pre>
  
  <p>and ...</p>
  
  <pre><code>'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'LabelFor' 
  and no extension method 'LabelFor' accepting a first argument of type 
  'System.Web.WebPages.Html.HtmlHelper' could be found 
  (are you missing a using directive or an assembly reference?)
  </code></pre>
  
  <p>...</p>
  
  <p>Any idea what would cause this?</p>
  
  <p>Edit:
  Config files as requested ....</p>
  
  <p>From main web.config file (not all of it as it's way too big to post)
       
          
          
          
          
          
          
        
        
          
          
          
          
          
            
              
              
              
              
              
              
              
              
              
              
              
            
          
          
            
              
              
              
              
              
              
            
            
              
              
              
              
              
              
              
              
              
              
              
            
          
      </p>
  
  <pre><code>&lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="Ninject" culture="neutral" publicKeyToken="c7192dc5380945e7" /&gt;
              &lt;bindingRedirect newVersion="3.0.0.0" oldVersion="0.0.0.0-3.0.0.0" /&gt;
          &lt;/dependentAssembly&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="Microsoft.Practices.EnterpriseLibrary.Validation" culture="neutral" publicKeyToken="31bf3856ad364e35" /&gt;
              &lt;bindingRedirect newVersion="5.0.505.0" oldVersion="0.0.0.0-5.0.505.0" /&gt;
          &lt;/dependentAssembly&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="System.Web" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /&gt;
              &lt;bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /&gt;
          &lt;/dependentAssembly&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt;
              &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt;
          &lt;/dependentAssembly&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" /&gt;
              &lt;bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.2.0.0" /&gt;
          &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
  &lt;/runtime&gt;
  </code></pre>
  
  <p>Config file in "~/Views/" ...</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;  
  &lt;configuration&gt;
      &lt;configSections&gt;
          &lt;sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
              &lt;section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /&gt;
              &lt;section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /&gt;
          &lt;/sectionGroup&gt;
      &lt;/configSections&gt;
  
      &lt;system.web.webPages.razor&gt;
          &lt;host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;pages pageBaseType="System.Web.Mvc.WebViewPage"&gt;
              &lt;namespaces&gt;
                  &lt;add namespace="System.Web.Mvc" /&gt;
                  &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
                  &lt;add namespace="System.Web.Mvc.Html" /&gt;
                  &lt;add namespace="System.Web.Routing" /&gt;
                  &lt;add namespace="Emedia.Common.Mvc.Views.Helpers"/&gt;
                  &lt;add namespace="Emedia.Common.Mvc.Views.Extensions"/&gt;
          &lt;add namespace="Emedia.Common.Utilities"/&gt;
          &lt;add namespace="Emedia.Common.Utilities.Extensions"/&gt; 
          &lt;add namespace="Emedia.Common.Mvc.Controllers.Helpers"/&gt;
                  &lt;add namespace="Emedia.Resources.Service"/&gt;
          &lt;add namespace="Emedia.Subscriber.Controllers"/&gt;
          &lt;add namespace="Emedia.Subscriber.Controllers.ViewModels"/&gt;
              &lt;/namespaces&gt;
          &lt;/pages&gt;
      &lt;/system.web.webPages.razor&gt;
  
      &lt;appSettings&gt;
          &lt;add key="webpages:Enabled" value="false" /&gt;
      &lt;/appSettings&gt;
  
      &lt;system.web&gt;
          &lt;httpHandlers&gt;
              &lt;add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/&gt;
          &lt;/httpHandlers&gt;
          &lt;pages
              validateRequest="false"
              pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
              pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
              userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"&gt;
              &lt;controls&gt;
                  &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" /&gt;
          &lt;/controls&gt;
      &lt;/pages&gt;
  &lt;/system.web&gt;
  
  &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;
  
      &lt;handlers&gt;
          &lt;remove name="BlockViewHandler"/&gt;
          &lt;add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /&gt;
      &lt;/handlers&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p></p>