Products Technologies Demo Docs Blog Support Company
TX Text Control 34.0 SP1 has been released - Learn more

TX Text Control Supports .NET 8 in ASP.NET Core Applications

At the .NET Conf 2023, Microsoft officially announced .NET 8, which is the next long term support (LTS) release after .NET 6. TX Text Control .NET Server supports ASP.NET Core applications built with .NET 8, and this article shows some performance improvements.

TX Text Control Supports .NET 8 in ASP.NET Core Applications

We are pleased to announce Day 0 support for the latest version of the .NET for TX Text Control .NET Server. At the .NET Conf 2023, Microsoft officially announced .NET 8. This new version is supported for 3 years with free support and patches and is the LTS successor to .NET 6.

.NET 8 release schedule

All update notes and especially the performance improvements can be found in a very detailed blog post by Stephen Toub.

Performance Improvements in .NET 8

TX Text Control .NET Server 32.0 supports .NET 8 applications and we have tested our libraries with early versions and the final release version.

Memory and Performance Improvements

To see how the memory footprint and performance improved, we created a simple ASP.NET Core Web App to test the new version.

Creating the Application

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

Download .NET 8.0

  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 6 project

Adding the NuGet Package

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

    Select Text Control Offline Packages from the Package source drop-down.

    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.

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

    using TXTextControl.Web;

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

    // enable Web Sockets
    app.UseWebSockets();
    
    // attach the Text Control WebSocketHandler middleware
    app.UseTXWebSocketMiddleware();

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:

    @using TXTextControl.Web.MVC
    
    @Html.TXTextControl().TextControl().Render()
    
    <input type="button" onclick="loadDocument()" value="Generate Document" />
    
    @section Scripts {
        <script>
            function loadDocument() {
                $.get('@Url.Action("LoadDocument")', function (data) {
                    TXTextControl.loadDocument(TXTextControl.StreamType.InternalUnicodeFormat, data);
                });
            }
        </script>
    }

    This code adds the Document Editor and a button to the view that loads a document generated in a server-side controller method.

  2. Find the HomeController.cs file in the Controllers folder. Insert the following method to the file:

    [HttpGet]
    [Route("Home/LoadDocument")]
    public IActionResult LoadDocument()
    {
        byte[] document;
    
        using (var tx = new TXTextControl.ServerTextControl())
        {
            tx.Create();
            tx.Load("App_Data/invoice.tx", TXTextControl.StreamType.InternalUnicodeFormat);
    
            var jsonData = System.IO.File.ReadAllText("App_Data/data.json");
    
            using (var mailMerge = new MailMerge { TextComponent = tx })
            {
                mailMerge.MergeJsonData(jsonData, true);
            }
    
            tx.Save(out document, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
        }
    
        return new JsonResult(document);
    }
  3. Create a folder named App_Data in the root of your project. Copy the files contained in this ZIP file into this folder.

Executing the Application

When the button is clicked, the MailMerge class is used to merge the JSON data into a template, which is then returned to the editor. The Visual Studio Diagnostic Tools are used to monitor memory usage and document merge time. These values will be compared to the same application that is running with .NET 6.

Start the application by pressing F5 and click the Generate Document button. The document is loaded and the merge process is started. The following screenshots shows the memory usage and the merge time:

.NET 8

In .NET 8, the maximum amount of memory that the application will use is 285 MB or process memory. The ServerGarbageCollection option is set to true for this demo. More information on the differences is available here: Workstation and server garbage collection.

The time it takes to load the template, merge the JSON data, and export the document, resulting in a 25-page document, is approximately 1.9 seconds.

Memory usage and merge time

.NET 6

The same application running with .NET 6 uses 451 MB of process memory. The average time to create the document using the same template and data is approximately 2.4 seconds.

Memory usage and merge time

Conclusion

NET 8 uses approximately 35% less process memory than .NET 6 for this particular benchmark application. The time it takes to generate the document in the controller method is reduced by about 18%.

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETASP.NET Core

AI-Ready Documents in .NET C#: How Structured Content Unlocks Better…

Most organizations use AI on documents that were never designed for machines. PDFs without tags, inconsistent templates, undescribed images, and disorganized reading orders are still common. This…


ASP.NETASP.NET CoreDocument Automation

Why Document Processing Libraries Require a Document Editor

A document processing library alone cannot guarantee reliable and predictable results. Users need a true WYSIWYG document editor to design and adjust templates to appear exactly as they will after…


ASP.NETWindows FormsWPF

TX Text Control 34.0 SP1 is Now Available: What's New in the Latest Version

TX Text Control 34.0 Service Pack 1 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ASP.NETASP.NET CoreConference

Scaling TX Text Control Document Editor Applications

Learn how to scale TX Text Control Document Editor applications effectively for enhanced performance and user experience. A practical guide for high performance architectures.


ASP.NETASP.NET CoreConference

Text Control at DDC 2025: Bringing Next-Generation Document Technology to…

This week, we exhibited at the DDC 2025 conference in Cologne. It's a small but important event for the .NET community in the German-speaking world. For us at Text Control, it was an opportunity…

Summarize this blog post with:

Share on this blog post on: