Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating ASP.NET MVC 5 project to ASP.NET 5

I have a working ASP.NET MVC 5 application and I need to run it under vNext. I assume there is no simple import possibility, so I'll need to do it manually. So basically I have a blank vNext project and a ready MVC5 project. I'll try to copy files and rewrite all dependencies in JSON config files. Maybe anyone tried to do something similar and can recommend best way and key points to achieve this task?

like image 822
vezucci Avatar asked Nov 07 '14 11:11

vezucci


People also ask

How can add migration in ASP.NET MVC?

Open the Package Manager Console. Select Tools > NuGet Package Manager > Package Manager Console. The Enable-Migration command creates the Migrations folder, which contains a script to initialize the database. Open the Configuration.

Is ASP.NET MVC 5 cross-platform?

The main difference between ASP.NET Core and ASP.NET MVC 5 is their cross-platform approach. ASP.NET Core can be used on Windows, Mac, or Linux, whereas ASP.NET MVC 5 can only be used for applications on Windows.


1 Answers

There are a few gotchas. One of them is the usage of notorious HttpContext.Current. It's basically gone in vNext. See if you have any usage for this inside your codebase.

As a general approach, in my personal opinion, do not ever try to upgrade an application in one go. There are so many new pieces that it's really hard to get a grasp of in a big giant app. Write small PoC samples to see each functionality in isolation. It will be easier to put them together when you know how each of them behave. I believe that's the best way to both learn the new system and understand the upgrade pains.

I have been following this approach to make it easy to move to the new system. It's a slower approach but it makes me learn the new system in a better way.

Also check out this discussion in ASP.NET Forums.

like image 102
tugberk Avatar answered Oct 04 '22 03:10

tugberk