Telerik blogs

Learn the five easy steps to migrate your existing ASP.NET MVC .NET 4.x/5/6 to Telerik UI for ASP.NET Core 7.

What is the Difference Between ASP.NET MVC and ASP.NET Core?

ASP.NET MVC    .NET Core logo

ASP.NET MVC is a web application framework developed by Microsoft that implements the model-view-controller (MVC) pattern. It is an open-source framework used for creating web applications. It allows developers to build dynamic, scalable and secure web applications.

ASP.NET Core is a cross-platform, open-source framework for building modern, cloud-based web applications. It is highly optimized for cloud deployment and is lighter and more modular than the whole .NET framework. It is built to be modular, so you can choose which components you need and easily plug them in. .NET Core includes libraries for ASP.NET Core MVC, Web API and Entity Framework Core.

Next, I’d like to introduce Telerik UI for ASP.NET Core, the professional-grade UI component library for modern web projects. Speed up your development time and maximize your coding efficiency with the help of over 100+ pre-built components, including popular, high-performance and modern responsive UI controls. Get advanced user controls like Grid, Scheduler, TreeView and more, with complete customization and styling, plus out-of-the-box support for popular platforms, including Angular, React and Vue. Develop fast and straightforward integrations to add a high-end experience to your web apps and websites used by worldwide enterprises. (And if you decide to stick with MVC, you can still use Telerik power with UI for ASP.NET MVC.)

Logos for Nasa, Visa, Microsoft      Logos for Fox, Samsung, IBM      Logos for World Bank Group and Volvo

But what benefits does ASP.NET Core offer over MVC .NET Framework 4? Or why migrate from ASP.NET MVC to ASP.NET Core?

  • Cross-platform support: ASP.NET Core is designed to run on Windows, macOS and Linux, making it an excellent choice for developing software on multiple platforms.
  • Higher performance: ASP.NET Core is designed to be a high-performance platform, providing better throughput and lower overhead than its predecessor.
  • Modular architecture: ASP.NET Core makes it much easier to build complex applications by allowing developers to break apps down into more manageable, modular components.
  • Cloud-ready: ASP.NET Core provides built-in support for deploying applications to the cloud, making it great for cloud development.
  • Support for open source: ASP.NET Core has been embraced by the open-source community, and an extensive list of libraries, tools, and frameworks is available for developing applications.
  • More robust security: ASP.NET Core includes many security improvements, such as role-based security, identity management, and claims-based authorization.

I have prepared these five steps from zero to start with Telerik UI for ASP.NET Core, migrating your existing ASP.NET MVC .NET Framework 4. The steps from .NET 5 or 6 are identical, with minor differences.

  1. Install the necessary setup.
  2. Create a new project based on the ASP.NET Core MVC project template.
  3. Install the necessary NuGet packages in the project and ensure all dependencies from your old solution.
  4. Move all controllers, models and views from your existing project to the new project.
  5. Implement any required ASP.NET Core migration tasks, such as updating routing or dependency injection.

How easy is it?

Circular gauge from easy at 1 to hard at 5 points to 1.5

To ensure the preservation of your original files, you need to have a backup from the original files or start a new branch or Git repository for this task. Remember that some of the components will not work with .NET Core, so you can look at the provider’s NuGet homepage for potential updates compatible with .NET Core.

If your team is not planning to update to the last version of .NET Core every year, like .NET 8, .NET 9, etc., you can use .NET 6 which is an LTS (Long-Term Support) version that will have official support until November 12, 2024.

Remember that in some cases, you will need to rewrite deprecated code.

Let’s Work on It!

1. Install the Necessary Setup

Visual Studio logo  Visual Studio 2022

Install Visual Studio 2022. You can use the Community version—its license can be used by one team or five individual developers, and each developer can use the license on up to five devices.

Download it from: http://launch.visualstudio.com/

In setup, select ASP.NET modules.

VS setup indicates selecting ASP.NET and web development

For .NET 6, you can use the previous version, Visual Studio 2019.

Install your License of Telerik UI for ASP.NET Core or a trial from https://www.telerik.com/download.

Create a free account if you still need to do this.

Enter your email to sign in or create an account on Telerik

Download the Control Panel from the Account page:

Account page shows Latest downloads for you

Select only Telerik UI for ASP.NET Core or let all components on:

Select products to install includes several Telerik and Kendo UI component libraries - choose at least Telerik UI for ASP.NET Core

2. Create a Visual Studio ASP.NET Core MVC Project

Once you have set up Telerik, access Visual Studio and create a new project based on the ASP.NET Core MVC project template.

Extensions - Telerik - Telerik UI for ASP.NET Core - Create New Telerik Project

Configure your new project - Telerik C# ASP.NET Core MVC Application

Select a blank template. I do recommend using the HTML Tag. In Telerik Kendo UI is the element that defines the structure and content of the webpage. The tag is the HTML used as markup to describe the component’s properties.

Create New Project screen has templates - blank is selected

3. Install NuGet Packages

Install the necessary NuGet packages in the project and ensure all dependencies from your old solution have been taken care of.

NuGet package manager

4. Move Controllers, Models and Views

Move all controllers, models and views from your existing project to the new project.

These are the main folders that you will act on.

project file structure with highlighting on controllers, models, views folders

5. Implement Required Migration Tasks

Implement any required ASP.NET Core migration tasks, such as updating routing or dependency injection.

Update ASP.NET Core components to reflect any changes in routing, dependency injection or other migration tasks. In addition, each member must be updated to reflect the changes of the new ASP.NET Core version to ensure the application runs securely and bug-free.

You can check a project with the state before and after migrating to Telerik UI for ASP.NET Core in my GitHub: https://github.com/jssmotta/AspnetMVC4.

After this process, you can start migrating your old components with the Telerik UI for ASP.NET Core components; you can find information on the online documentation at https://docs.telerik.com/aspnet-core/introduction.

You can contact Telerik’s legendary support team at any time—even during your free trial—to solve any questions about the products.

Try UI for ASP.NET Core

Using Telerik UI for ASP.NET MVC and curious about how to migrate to Telerik UI for ASP.NET Core? Check out this post: How to Migrate from Telerik UI for ASP.NET MVC to UI for ASP.NET Core.


About the Author

Jefferson S. Motta

Jefferson S. Motta is a senior software developer, IT consultant and system analyst from Brazil, developing in the .NET platform since 2011. Creator of www.Advocati.NET, since 1997, a CRM for Brazilian Law Firms. He enjoys being with family and petting his cats in his free time. You can follow him on LinkedIn and GitHub.

Related Posts

Comments

Comments are disabled in preview mode.