Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some (official or not) upgrade Mvc3 to Mvc5 guide?

There is a (non-Microsoft) NuGet package that allows upgrading the Mvc3 to Mvc4.

There is a (Microsoft) article that explains how to manually migrate from Mvc3 to Mvc4. We can read from that article, by ex:

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

Now, is there something similar that allows migrating from MVC3 to MVC5?

Is there sufficient to migrate first from 3 to 4, and then re-target the framework version (to 4.5) and install the official MVC nu-get?

like image 910
serhio Avatar asked Mar 25 '14 17:03

serhio


People also ask

What is difference between MVC4 and MVC5?

Identity feature in mvc4 is not available where as this is available in mvc5. 2. Authentication filter is not available in MVC4 where as Authentication filter is available in MVC5. Authentication filter is a new kind of filter in ASP.NET that runs prior to the authentication in MVC.

What is mvc3 application?

ASP.NET MVC 3 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the . NET Framework. It installs side-by-side with ASP.NET MVC 2, so get started using it today! Download the installer here.

How to upgrade MVC 3 to MVC 5 in Visual Studio?

Step 1: Open your MVC 3 application in Visual Studio and change the .net framework to 4.5 as MVC 5 runs on this framework. Step 2: Install Asp.Net MVC 5 version through Package Manager Console. Nuget Package Manage → Package Manager Console and run above command. Step 4: Check System.Web.Razor, System.Web.Helpers, System.WebPages.Razor versions.

How to migrate an MVC 3 application to MVC 5?

In this article we discuss about how to migrate an MVC 3 application to MVC 5. Step 1: Open your MVC 3 application in Visual Studio and change the .net framework to 4.5 as MVC 5 runs on this framework. Step 2: Install Asp.Net MVC 5 version through Package Manager Console. Nuget Package Manage → Package Manager Console and run above command.

How to change the GUID of a MVC 4 project?

Final Steps. 1 In Solution Explorer, right-click the project name and then select Unload Project. 2 Right-click the project and select Edit ProjectName.csproj. 3 Locate the ProjectTypeGuids element and then remove the MVC 4 project GUID, {E3E379DF-F4C6-4180-9B81-6769533ABE47}. 4 Save and close the open project file. 5

What's new in ASP NET MVC 5?

ASP.Net MVC 5 bring a host of new features, for example attribute routing, authentication filters etc. Go to this link for more details. If something goes wrong, you’ll have a working backup. WebApiConfig.Register (GlobalConfiguration.Configuration) GlobalConfiguration.Configure (WebApiConfig.Register)


1 Answers

Due to the installation of VS2015 I had to convert my applications from MVC3 on MVC5. I've done this with success :). I hope that the following description will help someone in a similar issue:

1) Change .Net Framework to 4.5

Project -> Properties -> Application -> Target Framework -> 4.5 

2) Install from Package Manager Console:

Install-Package Microsoft.AspNet.Mvc -Version 5.2.3 

3) There is a line in web.config that is:

<add key="webpages:Version" value="1.0.0.0" /> 

Changed it to the version of system.web.webpages.dll in your bin folder:

<add key="webpages:Version" value="3.0.0.0" /> 

4) If your project uses the EntityFramework you have to upgrade it to version 5.x or higher and set dll references to

....\net45\EntityFramework.dll ....\net45\EntityFramework.SqlServer.dll 

5) To solve problems like:

Error   CS0104  'Compare' is an ambiguous reference between 'System.ComponentModel.DataAnnotations.CompareAttribute' and 'System.Web.Mvc.CompareAttribute' 

you can add:

using CompareAttribute = System.Web.Mvc.CompareAttribute; 

6) You will probably have to change additional definitions in the web.config and the Views\web.config and find and replace text as shown below:

System.Web.Mvc, System.Web.Mvc.*, System.Web.Razor, System.Web.WebPages.Razor change from 3.0.0.0 to 5.0.0.0

System.Web.WebPages, System.Web.WebPages.* change from 1.0.0.0 to 3.0.0.0

That's all :)

like image 130
Jerzy Gebler Avatar answered Sep 24 '22 18:09

Jerzy Gebler