Upgrading to MVC 5.1 is breaking RouteConfig.cs

Topics: ASP.NET MVC, ASP.NET Web Pages, General
Jan 31, 2014 at 10:41 PM
The following line is breaking with the following exception after upgrading to MVC 5.1 via NuGet. Apparently System.Web.WebPages is supposed to have an object called TypeHelper, but it doesn't exist in the DLL downloaded with NuGet.
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
An exception of type 'System.MissingMethodException' occurred in System.Web.Mvc.dll but was not handled in user code

Additional information: Method not found: 'System.Web.Routing.RouteValueDictionary System.Web.WebPages.TypeHelper.ObjectToDictionaryUncached(System.Object)'.
Mar 14, 2014 at 12:19 AM
Any updates on this? I am running into the same issue. Clean install of VS 2013, Create a MVC project, Upgrade it, debug and I get this exception.
Mar 14, 2014 at 10:25 AM
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 .
Coordinator
Mar 14, 2014 at 5:32 PM
Do you have Visual Studio 2013 Update 1 installed?

Daniel Roth
Apr 10, 2014 at 5:06 PM
I'm getting the exact same issue having just upgraded my project through nuget to mvc 5.1
  • I do have vs2013 update 1
  • I do seem to be using 3.0.20129.0 version of webpages.dll
Has anyone any more insight?

Best
Rich
Apr 10, 2014 at 8:03 PM
Hi,

I am unable to repro this issue. Can you please let me know what version of MVC are you upgrading from? Is it 4.0 or 5.0? If you can also share the repro project it will help investigate this further.

Thanks,
Kanchan
Apr 18, 2014 at 2:59 PM
Edited Apr 18, 2014 at 3:07 PM
Hi,

I 've upgraded my application from MVC 4 to MVC 5.1.
You should see if System.Web.WebPages.dll and System.Web.WebPages.Razor.dll and the rest of System.Web.WebPages.__*__.dll have all the same version.

Elyes Bettaib
Apr 18, 2014 at 6:13 PM
I tried upgrading a new MVC 4 application to MVC 5.1 as mentioned in your repro but don't see this error. Could you please look for all existences of System.Web.WebPages.dll on your machine? You could have some version that is conflicting in the GAC or cache? If you can upload your repro project it will help.