Products Technologies Demo Docs Blog Support Company

Upgrading an ASP.NET MVC Web Application to an ASP.NET Core Web App

This article explains how to upgrade a .NET Framework ASP.NET MVC Web Application to an ASP.NET Core Web App using the .NET Upgrade Assistant.

Upgrading an ASP.NET MVC Web Application to an ASP.NET Core Web App

This tutorial shows how to upgrade a .NET Framework ASP.NET MVC Web Application to an ASP.NET Core Web App by using the .NET Upgrade Assistant. In addition, you will learn how to replace the references to the TX Text Control with the corresponding NuGet packages.

The project that is used in this tutorial uses the ServerTextControl and MailMerge classes and the Document Editor.

.NET Upgrade Assistant

  1. Install the .NET Upgrade Assistant Visual Studio extension.
  2. Open your ASP.NET MVC project in Visual Studio.
  3. In Solution Explorer, right-click the project you want to upgrade and select Upgrade. Select Side-by-side incremental project upgrade, which is the only upgrade option.
  4. For the upgrade target, select New project and click Next.
  5. Choose a name for your new project, select ASP.NET Core MVC as the project template and click Next.
  6. Select your preferred target framework, such as .NET 6. Click Next and Finish to convert the project.
  7. The Summary step displays: <Framework ProjectName> is now connected to <Framework ProjectNameCore> via Yarp proxy. Select Upgrade Controller and then select the controllers to upgrade.

    TXWebSocketController

    Do not convert TXWebSocketController. This controller is no longer needed.

  8. Select the components to upgrade, then click Upgrade selection.

Adding the NuGet Package

Once all views, controllers, and classes have been updated, the TX Text Control references must be added using NuGet. These references are not converted automatically, but since TX Text Control provides easy-to-install NuGet packages, this step is very easy.

  1. In the Solution Explorer, select your created project and choose Manage NuGet Packages... from the Project main menu.

    Package Source

    Select either Text Control Offline Packages or nuget.org as the Package source. Packages in the official Text Control NuGet profile are frequently updated.

    Install the latest versions of the following packages:

    • TXTextControl.TextControl.ASP.SDK
    • TXTextControl.Web

    ASP.NET Core Web Application

Configure the Application

  1. Open the Program.cs file located in the project's root folder. Add the following code after the entry app.UseStaticFiles();:

    // serve static linked files (JavaScript and CSS for the editor)
    app.UseStaticFiles(new StaticFileOptions
    {
        FileProvider = new Microsoft.Extensions.FileProviders.PhysicalFileProvider(
           System.IO.Path.Combine(System.IO.Path.GetDirectoryName(
               System.Reflection.Assembly.GetEntryAssembly().Location),
               "TXTextControl.Web")),
        RequestPath = "/TXTextControl.Web"
    });
    
    // enable Web Sockets
    app.UseWebSockets();
    
    // attach the Text Control WebSocketHandler middleware
    app.UseMiddleware<TXTextControl.Web.WebSocketMiddleware>();

That is all. After these steps, you should be able to successfully compile and run your application.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

ASP.NETASP.NET CoreDocument Editor

Getting Started Video Tutorial: Document Editor in ASP.NET Core C# on Linux

This video tutorial shows how to use the Document Editor in an ASP.NET Core application using C# and deploy on Linux using Docker. This tutorial is part of the TX Text Control Getting Started…


ASP.NETApp ServicesASP.NET Core

Deploying the TX Text Control Document Editor in an ASP.NET Core Web App to…

This tutorial shows how to deploy the TX Text Control Document Editor to Azure App Services using an ASP.NET Core Web App. The Document Editor is a powerful word processing component that can be…


AngularASP.NETBlazor

Building an ASP.NET Core Backend (Linux and Windows) for the Document Editor…

This article shows how to create a backend for the Document Editor and Viewer using ASP.NET Core. The backend can be hosted on Windows and Linux and can be used in Blazor, Angular, JavaScript, and…


ASP.NETBlazorASP.NET Core

TX Text Control for Blazor: Mail Merge Integration Tutorial

This tutorial shows how to integrate the TX Text Control MailMerge component into a Blazor application using the TX Text Control .NET Server.


ASP.NETBlazorASP.NET Core

TX Text Control Document Editor and Viewer for Blazor Released

We are very happy to announce the immediate availability of TX Text Control packages for Blazor. This article gives an overview of the available packages and how to use them.