2

The reason why I want to upgrade from MVC4 to MVC5 is because MVC5 has Entity Framework Identity already there. I don't want to spend time trying to add Identity to my MVC4 project because it'll take too much time.

Is there like an update button which does it automatically or do I need to create a MVC5 template and copy codes over?

TykiMikk
  • 1,058
  • 3
  • 15
  • 31

2 Answers2

2

I upgraded from MVC4 to MVC5 by copying some files from the existing MVC4 project and some files from a new MVC5 web application project into a new empty project.

The issue for me was migrating from SimpleMembership authentication to Identity. I documented the steps I took in this answer: How to migrate from SimpleMembership to ASP.NET.Identity

If you aren't using SimpleMembership already, I would copy files straight from the MVC4 to the MVC5 Web Application.

Community
  • 1
  • 1
Colin
  • 22,328
  • 17
  • 103
  • 197
1

I upgraded form MVC4 to MVC5 by following the steps at this link

How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2

that walk you through steps to upgrade from MVC4 to MVC5

Here is a quick summary of the upgrade steps.

  1. Backup your project, as it upgrade will involve changes to package configuration and web.config files.

  2. upgrade from Web API to Web API 2 by making some changes in global.asax

  3. Make sure all the packages that your projects use are compatible with MVC 5 and Web API 2. They provide a table of package versions from Microsoft packages

  4. Open project in Visual Studio.

  5. Using Package Manager Console (PMC), remove certain ASP.Net NuGet packages if installed.

  6. Upgrade all the ASP.Net NuGet packages using the PMC

They show how to: Update the Application web.config File and Update the web.config files under the Views folder

Check out the link and see if that helps.

Nkosi
  • 235,767
  • 35
  • 427
  • 472
  • Is it possible to just create a new MVC5 project. Import Models,Viewmodels,Controllers and Views over? It seems like such a hassle to do all those things. – TykiMikk Mar 23 '16 at 18:11
  • Yes you could. But it's good to know if any of what you are bringing over will have any issues on the other version. I wend the upgrade route as I wasn't sure what would break if I created a new project – Nkosi Mar 23 '16 at 18:14
  • Ok. I didn't realize that because I had forked the PageList.MVC code locally into my project and haven't had any issues with it since the upgrade. – Nkosi Mar 23 '16 at 18:37
  • It was my mistake! It's actually there. – TykiMikk Mar 23 '16 at 18:43