DocumentViewer for .NET Core 3.1 Released
We just published a multi-platform NuGet package including a .NET Core version of the TX Text Control DocumentViewer.

We just published a multi-platform NuGet package that includes a .NET Framework 4.5 and a .NET Core 3.1 assembly version. The functionality of the .NET Core version is exactly the same like the full framework version and can be easily used to port your projects to .NET Core 3.1.
Why Is .NET 3.1 Supported and Not .NET 2.1?
Word processing is a complex task and requires some high-performance modules which are written in C++. Finally, the .NET Core 3.1 runtime added support for IJW C++/CLI on Windows that makes .NET Core 3.1 a usable target for TX Text Control applications running on Windows.
Additionally, the official package System.Drawing.Common from Microsoft provides access to GDI+ graphics functionality which is required in TX Text Control applications.
Creating the Application
The following tutorial shows how to create an ASP.NET Core 3.1 Web Application that can be deployed to Windows machines.
-
In Visual Studio 2019 (> 16.04), create a new project and select ASP.NET Core Web Application as the project template.
-
Select a project name (myDotnetCoreApp in this sample), location and solution name in the next dialog and confirm with Create.
-
In the last dialog, select .NET Core and ASP.NET Core 3.1 as the project target, select Web Application (Model-View-Controller) as the template and confirm with Create.
-
Open the Package Manager Console by choosing Package Manager Console from the Tools -> NuGet Package Manager main menu and type in the following command to install the TXTextControl.Web.DocumentViewer package:
PM> Install-Package TXTextControl.Web.DocumentViewer
-
While the project is selected in the Solution Explorer, choose Project -> Add Reference... to open the Reference Manager. In the opened dialog, select Browse... to select the required TX Text Control assemblies. Navigate to the installation folder of TX Text Control and select the following assemblies from the Assembly folder:
- TXDocumentServer.dll
- TXTextControl.dll
- TXTextControl.Server.dll
- TXDrawing.dll
Repeat this step with the following assemblies from the Assembly/bin64 folder:
- txic.dll
- txkernel.dll
- txtools.dll
- txpdf.dll
After selecting these assemblies, close the Reference Manager by confirming with OK.
-
While the project is selected in the Solution Explorer, choose Project -> Add Existing Item.... Browse to the TX Text Control installation folder and select the following files from the Assembly/bin64:
- tx28_xml.dll
- tx28_css.dll
- tx28_doc.dll
- tx28_dox.dll
- tx28_htm.dll
- tx28_pdf.dll
- tx28_rtf.dll
- tx28_xlx.dll
-
Select the files from step 6 in the Solution Explorer and set the Copy to Output Directory to Copy always.
-
While the project is selected in the Solution Explorer, choose Project -> Add New Item.... Select Text File, name the file licenses.licx and close the dialog by clicking Add.
Open the newly added file and add the following content:
TXTextControl.ServerTextControl, TXTextControl.Server, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638
Set the Copy to Output Directory property to Copy Always.
-
Projects built with .NET Core 3.1 are not able to compile licenses into the resources using the license compiler. This manual step is required for licensed controls in .NET Core 3.1 applications.
Build the application now by pressing F6 or choose Build Solution from the Build main menu.
-
Open a Developer Command Prompt with explicit administrator rights and change the directory to the project output directory such as \bin\debug\dotnetcoreapp3.1. Type in the following command:
lc.exe /target:myDotnetCoreApp.dll /complist:licenses.licx /i:"TXTextControl.Server.dll"
Where myDotnetCoreApp.dll is the assembly name of your web application.
-
Now, type in the following command to rename and move the created license file to the project's root folder:
move myDotnetCoreApp.dll.licenses ..\..\..\dll.licenses
-
Back in Visual Studio, select the file dll.licenses in the Solution Explorer and set the Build Action to Embedded Resource.
-
While the project is selected in the Solution Explorer, create a new folder and name it App_Data by choosing New Folder from the Project main menu.
Select the App_Data folder and click Add Existing Item... from the Project main menu.
Browse to the following TX Text Control installation folder:
C:\Program Files\Text Control GmbH\TX Text Control 28.0.NET Server for ASP.NET\Samples\Demo\
Select the file demo.rtf and confirm with Add.
-
Open the file Startup.cs and insert the following code anywhere to the Configure method to enable the App_Data folder:
string baseDir = env.ContentRootPath; AppDomain.CurrentDomain.SetData("DataDirectory", System.IO.Path.Combine(baseDir, "App_Data"));
-
Open the Index.cshtml view from the Views -> Home folder and delete the pre-defined code and replace it with the following:
@using TXTextControl.Web.MVC.DocumentViewer @using System.IO; @Html.TXTextControl().DocumentViewer(settings => { settings.DocumentPath = AppDomain.CurrentDomain.GetData("DataDirectory").ToString() + "\\demo.rtf "; settings.Dock = DocumentViewerSettings.DockStyle.Window; }).Render()
Compile and start your application by pressing F5.
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.
- Angular
- Blazor
- React
- JavaScript
- ASP.NET MVC, ASP.NET Core, and WebForms
Related Posts
ASP.NETJavaScriptDocumentViewer
Using the MVC DocumentViewer in ASP.NET Web Forms
The ASP.NET MVC DocumentViewer for ASP.NET provides more features including document signing capabilities than the DocumentViewer for Web Forms. This article shows how to use the MVC…
AngularASP.NETDocument Processing
Creation of Custom Electronic Signature Boxes
This article describes the customization of electronic signature boxes. It contains further explanations including the creation of templates and shows all code snippets required. The step-by-step…
ASP.NETDocumentViewerElectronic Signature
DocumentViewer Preview: Completing Form Fields
We just published a pre-release version of the DocumentViewer for ASP.NET (Core) that supports the completion of form fields within a document signing process.
Angular DocumentViewer: Loading Documents from an ASP.NET Core Backend Web API
This article shows how to load documents from an ASP.NET Core API Controller into TX Text Control DocumentViewer for Angular.
Document Collaboration: Implementing Comments with Document Targets
This article explains how to implement comments based on document targets in the online document editor.