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 TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
ServerTextControl Class
The ServerTextControl class implements a component that provide high-level text processing features for server-based applications.
and MailMerge TX Text Control .NET Server for ASP.NET
DocumentServer Namespace
MailMerge Class
The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services.
classes and the Document Editor TX Text Control .NET Server for ASP.NET
Web.MVC Namespace
TextControl Class
The TextControl class represents an extension object implementing the Text Control rich text editor functionality.
.

.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>();
    view raw startup.cs hosted with ❤ by GitHub

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