Updating MVC4 to MVC5
In my last article on MVC, I updated Razor 2.0 to 3.0 and showed the difficulties of updating the Razor nuget package in a MVC application. This article picks up from there and since Razor 3.0 is dependent on MVC5 I can assume you have updated Razor already.
Typical errors you will see..
Updating the System.Web.WebPages to version 3.0 fixed this issue. However you may see more packages issues like it.
What you can do is try reinstall each package that appears to be broken like so..
Update-Package –reinstall <packageName>
Or try to do a complete reinstall of all packages... install/update all nuget packages. This problem is an common problem I have faced with Updated MVC however I have faced a few others but they were on constant with each build. It can also help to clean and rebuild your application after you update your packages.
Update
Resources
Official Microsoft ASP.NET Site
How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2
asp.net mvc - upgrading from MVC4 to MVC5 pre-Release - Stack Overflow
Upgrading target framework from 4.0 to 4.5 for ASP.NET MVC applications - Prashant Upadhyay
Typical errors you will see..
Method not found: 'System.Web.WebPages.IDisplayMode System.Web.Mvc.ControllerContext.get_DisplayMode()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: Method not found: 'System.Web.WebPages.IDisplayMode System.Web.Mvc.ControllerContext.get_DisplayMode()'.
Updating the System.Web.WebPages to version 3.0 fixed this issue. However you may see more packages issues like it.
What you can do is try reinstall each package that appears to be broken like so..
Update-Package –reinstall <packageName>
Or try to do a complete reinstall of all packages... install/update all nuget packages. This problem is an common problem I have faced with Updated MVC however I have faced a few others but they were on constant with each build. It can also help to clean and rebuild your application after you update your packages.
Update
Could not load file or assembly 'Antlr3.Runtime (1)' or one of its dependencies
.net - Could not load file or assembly 'Antlr3.Runtime (1)' or one of its dependencies
Resources
Official Microsoft ASP.NET Site
How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2
asp.net mvc - upgrading from MVC4 to MVC5 pre-Release - Stack Overflow
Upgrading target framework from 4.0 to 4.5 for ASP.NET MVC applications - Prashant Upadhyay