Prerequisites

You need to download and install the trial version of TX Text Control .NET Server for ASP.NET to host the Document Editor backend:

Creating the Application

Make sure that you downloaded the latest version of Visual Studio 2022 that comes with the .NET 8 SDK.

  1. In Visual Studio 2022, create a new project by choosing Create a new project.

  2. Select ASP.NET Core Web App (Model-View-Controller) as the project template and confirm with Next.

  3. Choose a name for your project and confirm with Next.

  4. In the next dialog, choose .NET 8 (Long Term Support) as the Framework and confirm with Create.

    Creating the .NET 8 project

Adding the Web Server Backend

  1. Create a new class by right-clicking the project in the Solution Explorer and choose Add -> Class.... Name the class TXWebServerProcess.cs and confirm with Add. Replace the complete content with the following code:

    Loading...
  2. Now right-click the project in the Solution Explorer and choose Add -> Existing Item.... Navigate to the installation folder of TX Text Control .NET Server for ASP.NET:

    C:\Program Files\Text Control GmbH\TX Text Control 33.0.NET Server for ASP.NET\Assembly\net8.0

    Set the file filter to All Files (*.*) and select the following files:

    • TXTextControl.Web.Server.Core.deps.json
    • TXTextControl.Web.Server.Core.dll
    • TXTextControl.Web.Server.Core.Process.deps.json
    • TXTextControl.Web.Server.Core.Process.dll
    • TXTextControl.Web.Server.Core.Process.runtimeconfig.json
    • TXTextControl.Web.Server.Core.runtimeconfig.json
    • TXTextControl.Web.Server.Core.config.json

    Confirm with Add.

  3. Select the added files in the Solution Explorer and set the Copy to Output Directory property to Copy always.

Adding the NuGet Packages

  1. In the Solution Explorer, select your created project and choose Manage NuGet Packages... from the Project main menu. Select Text Control Offline Packages as the Package source.

    Install the following packages:

    • TXTextControl.Web
    • TXTextControl.TextControl.Core.SDK

    ASP.NET Core Web Application

Configure the Application

  1. Open the Program.cs file located in the project's root folder.

    After builder.Services.AddControllersWithViews();, add the following code:

    Loading...

    At the very top of the file, insert the following code:

    Loading...

    Add the following code after the entry app.UseStaticFiles();:

    Loading...

    The overall Program.cs file should look like this:

    Loading...

Adding the Control to the View

  1. Find the Index.cshtml file in the Views -> Home folder. Replace the complete content with the following code to add the document editor to the view:

    Loading...

Starting the Application

  1. Select WSL as the startup profile and start the application.

    Starting the application

Enable WSL (Windows Subsystem for Linux)

In case you haven't enabled WSL yet, follow these steps:

Enable WSL (Windows Subsystem for Linux)

  1. Open PowerShell as an administrator.

  2. Run the following command:

    wsl --install

    This installs the default Linux distribution (usually Ubuntu) and enables necessary features.

  3. After the installation, restart your computer.

Set WSL 2 as the Default Version

To set WSL 2 as the default version, follow these steps:

  1. Open PowerShell as an administrator.

  2. Run the following command:

    wsl --set-default-version 2

  3. If you haven?t installed a Linux distribution yet, you can do so via:

    wsl --install -d Ubuntu