我为使用ASP.NET MVC 3 源代码创建新的Project ASP.NET MVC 3 RTM和替换引用
但是当我再次运行项目时,得到以下异常:
[A] System.Web.WebPages.Razor.Configuration.HostSection无法强制转换为[B] System.Web.WebPages.Razor.Configuration.HostSection.类型A源自'System.Web.WebPages.Razor,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35',位于'默认'位置'C:\ Windows\Microsoft.Net\assembly\GAC_MSIL\System .Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll".类型B源自'System.Web.WebPages.Razor,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null',位于'默认'位置'C:\ Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2505c7ee\369315c5\assembly\dl3\f7bae428\d03eeed8_85bbcb01\System.Web.WebPages.Razor.DLL'.
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
来源错误:
Line 106: internal static RazorWebSectionGroup GetRazorSection(string virtualPath) {
Line 107: // Get the individual sections (we can only use GetSection in medium trust) and then reconstruct the section group
Line 108: return new RazorWebSectionGroup() {
Line 109: Host = (HostSection)WebConfigurationManager.GetSection(HostSection.SectionName, virtualPath),
Line 110: Pages = (RazorPagesSection)WebConfigurationManager.GetSection(RazorPagesSection.SectionName, virtualPath)
Run Code Online (Sandbox Code Playgroud)
源文件:E:\ …