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" In the "C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\ System.Web.WebPages.Razor.dll "location). Type B originates from "System.Web.WebPages.Razor, version=3.0.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35" (In the context "Default" In the "C:\Users\JimDeng\AppData\Local\Temp\Temporary ASP. NET Files\root\6591f712\57f6afbd\assembly\dl3\199130ac\ 5d367934_02f5d001\system.web.webpages.razor.dll "location).
8. Stack Trace
The reason for this is that the reference was updated, but the configuration file was not updated and the version of the Web. config file needed to be updated manually (including the view below)
A System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B] System.Web.WebPages.Razor.Configuration.HostSection