[A]System.Web.WebPages.Razor.Configuration.HostSection 沒法強制轉換爲

「/」應用程序中的服務器錯誤。


[A]System.Web.WebPages.Razor.Configuration.HostSection 沒法強制轉換爲 [B]System.Web.WebPages.Razor.Configuration.HostSection。類型 A 源自「System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35」(在上下文「Default」中的「C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll」位置處)。類型 B 源自「System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35」(在上下文「Default」中的「C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\7bbdc962\4cf2d8fd\assembly\dl3\8daee47e\90137f27_720bd201\System.Web.WebPages.Razor.dll」位置處)。

說明: 執行當前 Web 請求期間,出現未經處理的異常。請檢查堆棧跟蹤信息,以瞭解有關該錯誤以及代碼中致使錯誤的出處的詳細信息。 

異常詳細信息: System.InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection 沒法強制轉換爲 [B]System.Web.WebPages.Razor.Configuration.HostSection。類型 A 源自「System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35」(在上下文「Default」中的「C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll」位置處)。類型 B 源自「System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35」(在上下文「Default」中的「C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\7bbdc962\4cf2d8fd\assembly\dl3\8daee47e\90137f27_720bd201\System.Web.WebPages.Razor.dll」位置處)。

源錯誤: 

web

執行當前 Web 請求期間生成了未經處理的異常。能夠使用下面的異常堆棧跟蹤信息肯定有關異常緣由和發生位置的信息。


堆棧跟蹤: 

windows

[InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection 沒法強制轉換爲 [B]System.Web.WebPages.Razor.Configuration.HostSection。類型 A 源自「System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35」(在上下文「Default」中的「C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll」位置處)。類型 B 源自「System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35」(在上下文「Default」中的「C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\7bbdc962\4cf2d8fd\assembly\dl3\8daee47e\90137f27_720bd201\System.Web.WebPages.Razor.dll」位置處)。]
   System.Web.WebPages.Razor.WebRazorHostFactory.GetRazorSection(String virtualPath) +151
   System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath, String physicalPath) +210
   System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath) +38
   System.Web.WebPages.Razor.RazorBuildProvider.GetHostFromConfig() +51
   System.Web.WebPages.Razor.RazorBuildProvider.CreateHost() +57
   System.Web.WebPages.Razor.RazorBuildProvider.get_Host() +56
   System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode() +77
   System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() +54
   System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +59
   System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +209
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +30
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +9973453
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +299
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
   System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
   System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) +10
   System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) +28
   System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetCompiledType(String virtualPath) +38
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +155
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +431
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +116
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +529
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +106
   System.Web.Mvc.Async.<>c__DisplayClass28.<BeginInvokeAction>b__19() +321
   System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +185
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +133
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +34
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +70
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +139
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
   System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +39
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +62

錯誤:服務器

解決方法:web.configapp

把原來的web.config排除掉,從新加載就行async

相關文章
相關標籤/搜索