Getting Started: Document Editor with ASP.NET Core and Linux WSL Support
In this article, we will create a simple document editor application using the Document Editor component from the TX Text Control .NET Server product. We will use ASP.NET Core and run the application on Linux using Windows Subsystem for Linux (WSL).

Prerequisites
You need to download and install the trial version of TX Text Control .NET Server to host the Document Editor backend:
- Download Trial Version
Setup download and installation required.
Creating the Application
Make sure that you downloaded the latest version of Visual Studio 2022 that comes with the .NET 8 SDK.
-
In Visual Studio 2022, create a new project by choosing Create a new project.
-
Select ASP.NET Core Web App (Model-View-Controller) as the project template and confirm with Next.
-
Choose a name for your project and confirm with Next.
-
In the next dialog, choose .NET 8 (Long Term Support) as the Framework and confirm with Create.
Adding the Web Server Backend
-
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:
…
-
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:
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.
-
Select the added files in the Solution Explorer and set the Copy to Output Directory property to Copy always.
Adding the NuGet Packages
-
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
Configure the Application
-
Open the Program.cs file located in the project's root folder.
After builder.Services.AddControllersWithViews();, add the following code:
…
At the very top of the file, insert the following code:
…
Add the following code after the entry
app.UseStaticFiles();
:…
The overall Program.cs file should look like this:
…
Adding the Control to the View
-
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:
…
Starting the Application
-
Select WSL as the startup profile and start 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)
Open PowerShell as an administrator.
Run the following command:
wsl --install
This installs the default Linux distribution (usually Ubuntu) and enables necessary features.
- After the installation, restart your computer.
Set WSL 2 as the Default Version
To set WSL 2 as the default version, follow these steps:
Open PowerShell as an administrator.
Run the following command:
wsl --set-default-version 2
If you haven't installed a Linux distribution yet, you can do so via:
wsl --install -d Ubuntu
Related Posts
ASP.NETASP.NET CoreDocument Editor
Introducing TXTextControl.Web.Server.Core: A Cross-Platform Backend for TX…
With the release of TX Text Control 33.0, we are excited to introduce TXTextControl.Web.Server.Core, a major upgrade in the way the document editor works on the backend. This article provides an…
ASP.NET CoreDocument ViewerLinux
Getting Started: Document Viewer with ASP.NET Core and Linux WSL Support
In this article, we will create a simple document viewer application using the Document Viewer component from the TX Text Control .NET Server product. We will use ASP.NET Core and run the…
Getting Started: Document Editor with ASP.NET Core and Docker Support with…
This article shows how to create a simple ASP.NET Core application using the Document Editor and deploy it in a Docker container on Linux. The article shows how to use the NuGet packages and how…
JavaScriptASP.NET CoreDocument Editor
Format Painter in ASP.NET Core: Building Custom Text Formatting with TX Text…
This article demonstrates how to build a Format Painter feature using the TX Text Control Document Editor, implementing format detection, copy and paste operations, and custom style handling…
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…