Upgrade MVC 3 to MVC 4

Upgrade MVC 3 to MVC 4

It is very simple to upgrade MVC 3 application to MVC 4. We have to follow the below steps to do it manually.

Step 1: Open web.config files that present in root folder and view folder of the application.

Step 2: Find all the place where “system.web.mvc” namespace used and change the version from 3.0.0.0 to 4.0.0.0.

Step 3: Do the same thing for assemblies “system.web.webpages“, “system.web.webpages.razor“, “System.Web.Helpers“, but this time need to replace version from 1.0.0.0 to 2.0.0.0.

Step 4: Add the below line in views/web.config under namespace tag.

Step 5: Add the below line in root web.config under appSettings tag.

and update key webpages:version from 1.0.0.0 to 2.0.0.0.

Step 6: In Solution Explorer, right-click the project name and then select Unload Project. Then right-click the name again and select Edit ProjectName.csproj.

Step 7: Locate the ProjectTypeGuids element and replace {E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47}.

Step 8: Save the changes, close the project (.csproj) file you were editing, right-click the project, and then select Reload Project.

Step 9: If the project references any third-party libraries that are compiled using previous versions of ASP.NET MVC, open the root Web.config file and add the following three bindingRedirect elements under the configuration section:

He is a product manager at a reputed software company and a freelance blog writer. He is experienced in different technologies, web securities, and web applications. He keeps learning and make himself up to date on the latest technologies, news, health, and fitness. This encouraged him to share his experiences by writing articles.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top
%d bloggers like this: