Tuesday, 29 November 2016

System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp Method not found

If you get the following issue

Server Error in '/' Application.

Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.

Description: An unhandled exception occurred.

Exception Details: System.MissingMethodException: Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: 'Boolean System.Web.WebPages.BuildManagerWrapper.IsNonUpdateablePrecompiledApp(System.Web.Hosting.VirtualPathProvider, Microsoft.Internal.Web.Utils.IVirtualPathUtility)'.]
   System.Web.Mvc.BuildManagerViewEngine.GetPrecompiledNonUpdateable() +0
   System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +141
   System.Web.Mvc.BuildManagerViewEngine.get_IsPrecompiledNonUpdateableSite() +136
   System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath) +43
   System.Web.WebPages.DefaultDisplayMode.GetDisplayInfo(HttpContextBase httpContext, String virtualPath, Func`2 virtualPathExists) +51
   System.Web.WebPages.DisplayModeProvider.GetDisplayInfoForVirtualPath(String virtualPath, HttpContextBase httpContext, Func`2 virtualPathExists, IDisplayMode currentDisplayMode, Boolean requireConsistentDisplayMode) +157
   System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List`1 locations, String name, String controllerName, String areaName, String cacheKey, String[]& searchedLocations) +466
   System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache) +203
   Castle.Proxies.Invocations.IViewEngine_FindView.InvokeMethodOnTarget() +274
   Castle.DynamicProxy.AbstractInvocation.Proceed() +111
   Glimpse.Core.Extensions.AlternateMethodContextExtensions.TryProceedWithTimer(IAlternateMethodContext context, TimerResult& timerResult) +64
   Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context) +32
   Castle.DynamicProxy.AbstractInvocation.Proceed() +448
   Castle.Proxies.IViewEngineProxy.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache) +334
   System.Web.Mvc.<>c__DisplayClass6.<FindView>b__5(IViewEngine e) +45
   System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths) +114
   System.Web.Mvc.ViewEngineCollection.FindView(ControllerContext controllerContext, String viewName, String masterName) +242
   System.Web.Mvc.ViewResult.FindView(ControllerContext context) +118
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +143
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +710


There is a good chance that one of the following nuget packages  hasn't been updated properly.

  • Glass.Mapper.Sc.Core
  • Microsoft.AspNet.Mvc
  • Microsoft.AspNet.Razor
  • Microsoft.AspNet.WebPages

It happens when you have few projects in solution and you have forgotten to update all the projects to use same version.
the easiest way is to right click on solution and select "Manage NuGet packages for solution..." then look into consolidate tab.


resource:
http://stackoverflow.com/questions/25279024/upgrading-to-mvc-5-2-0-0-causes-exception-method-not-found-boolean-system-web

Post a Comment