title: Razor 2 to Razor 3 MVC 5
body: <p>I've been working on an MVC 4 solution, and I've been trying to upgrade it to MVC 5. I've followed the steps outlined <a href="http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2">here</a>.</p>
  
  <p>I've followed it, and now whenever I run the MVC Application, it gives me this error message:</p>
  
  <pre><code>[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to 
  [B]System.Web.WebPages.Razor.Configuration.HostSection. 
  
  Type A originates from 
  'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, 
  PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
  'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. 
  Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, 
  PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
  'C:\Users\User\AppData\Local\Temp\Temporary ASP.NET 
  Files\root\665ac028\de53a189\assembly\dl3\c2c0a4b5\56e8099e_40e0ce01\System.Web.WebPages.Razor.dll'.
  </code></pre>
  
  <p>Does anyone know how this could have originated? or how it can be solved? I've looked around thus far? I've tried changing the web.config files, with no avail...</p>