Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mvc 5.1 MissingMethodException System.Web.WebPages.TypeHelper.ObjectToDictionaryUncached

I'm update my MVC5 project to MVC5.1 and now have exception on route dictionary:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

stack trace:

{"Method not found: 'System.Web.Routing.RouteValueDictionary System.Web.WebPages.TypeHelper.ObjectToDictionaryUncached(System.Object)'."}

at System.Web.Mvc.RouteCollectionExtensions.CreateRouteValueDictionaryUncached(Object values)
at System.Web.Mvc.RouteCollectionExtensions.IgnoreRoute(RouteCollection routes, String url, Object constraints)
at System.Web.Mvc.RouteCollectionExtensions.IgnoreRoute(RouteCollection routes, String url)
at WebApplication1.RouteConfig.RegisterRoutes(RouteCollection routes) in c:\Users\aivanov\Documents\Visual Studio 2013\Projects\WebApplication1\WebApplication1\App_Start\RouteConfig.cs:line 14
at WebApplication1.MvcApplication.Application_Start() in c:\Users\aivanov\Documents\Visual Studio 2013\Projects\WebApplication1\WebApplication1\Global.asax.cs:line 17
like image 734
user3239672 Avatar asked Jan 27 '14 08:01

user3239672


2 Answers

In the References i found that System.Web.WebPages.dll version 3.0.11001.0 shows this type of error, but when i replace it with System.Web.WebPages.dll version 3.0.20129.0 it works. So Simply you should delete the old one from refrences and download the other version and than clean solution, rebuild and it will work.

like image 81
Leonardo Avatar answered Dec 05 '22 18:12

Leonardo


In my case helped deleting files in temporary folder "C:\Users{yourprofilename}\AppData\Local\Temp\Temporary ASP.NET Files\"

like image 24
Sergey Lazutkin Avatar answered Dec 05 '22 19:12

Sergey Lazutkin