找不到方法:GetDefaultCompilerTypeForLanguage

时间:2015-12-13 22:55:18

标签: asp.net visual-studio-2015

当我打开一个全新的ASP.NET MVC 5项目(在VS2015社区版中创建)时,我收到一个黄色屏幕错误:

Method not found: 'System.Web.Compilation.CompilerType System.Web.Compilation.BuildProvider.GetDefaultCompilerTypeForLanguage(System.String)

这很奇怪,因为如果我用System.Web.dll查看ildasm,那么该方法确实存在。

这种情况昨天开始发生,之前一切正常。

我的Visual Studio或.net安装有什么问题吗?我试图修复VS安装,但没有帮助。

这是完整的堆栈跟踪

[MissingMethodException: Method not found: 'System.Web.Compilation.CompilerType System.Web.Compilation.BuildProvider.GetDefaultCompilerTypeForLanguage(System.String)'.]
   System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() +0
   System.Web.Compilation.BuildProvider.w(BuildProvider buildProvider) +59
   System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +212
   System.Web.Compilation.BuildProvidersCompiler.B�����\�¨Ia����3�4��U
endstream
endobj
33 0 obj
<</Filter/FlateDecode/Length 2550/Length1 5268>>stream
s z�F�Jnj6��ǥ����B��s�FV�
.p��(��¸n����j�i�傴bV��.2���՗�$nLӕ?�"�g�n�����A() +29
   System.Web.Compilation.BuildManager.)�|���t�7��я�_�z(VirtualPath virtualPath) +10058085
   System.Web.Compilation.BuildManager.1�(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +294
   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) +15
   System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) +29
   System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetCompiledType(String virtualPath) +6
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +54
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +52
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +173
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9721613
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

0 个答案:

没有答案