Creating a .NET Console Application with Visual Studio Code and TX Text Control (on Linux)
This article describes how to create a .NET console application using Visual Studio Code and TX Text Control on Linux. It covers installing the .NET SDK, creating a new project, and adding TX Text Control to the project.

Visual Studio Code (VS Code) is a free, lightweight, open source code editor developed by Microsoft. It supports multiple programming languages, including JavaScript, Python, C#, and many others, and runs on Windows, MacOS, and Linux.
In this tutorial, you will learn how to create a new .NET console application using .NET 8 or later and how to use the Server
Prerequisites
To follow this tutorial, you need to have the following software installed:
- Visual Studio Code (VS Code)
- .NET 8 or later
TX Text Control NuGet Packages
To use TX Text Control, you must have access to the TX Text Control NuGet packages. Currently, you need to install the setup (full or trial) to get the NuGet packages installed locally. The setup is available for Windows only, but the NuGet packages can be copied to your preferred system and hosted in your own NuGet package repository, such as Azure Artifacts.
Use the following link to download your own copy of the TX Text Control trial setup.
Create a new .NET console application
To create a new .NET console application, follow these steps:
- Open Visual Studio Code.
- Open the integrated terminal (View > Terminal).
-
Run the following command to create a new .NET console application:
dotnet new console -n MyTextControlApp -
Change to the project directory:
cd MyTextControlApp -
Open the project in Visual Studio Code:
code .
Adding NuGet.config
To use the TX Text Control NuGet packages, you need to add a NuGet.config file to your project. This file contains the configuration for NuGet package sources.
To add the NuGet.config file, follow these steps:
- In the root directory of your project, create a new file named NuGet.config.
-
Add the following content to the
NuGet.configfile:<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="TextControlLocal" value="C:\Program Files (x86)\Text Control GmbH\NuGetPackages" /> </packageSources> </configuration>Your NuGet Source
Replace the value of the value attribute with the path to your local NuGet packages. This can be a local folder or a URL to your own NuGet package repository. The example above uses the default TX Text Control Offline NuGet package source.
- Save the
NuGet.configfile.
Adding the TX Text Control NuGet packages
To add the TX Text Control NuGet packages to your project, follow these steps:
-
In the integrated terminal, run the following command to add the TX Text Control NuGet packages:
dotnet add package TXTextControl.TextControl.Core.SDK
Creating a PDF file
To create a PDF file using the Server
- Open the Program.cs file in your project.
-
Replace the existing code with the following code:
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { tx.Create(); tx.Text = "This is a sample document."; tx.Save("sample.pdf", TXTextControl.StreamType.AdobePDF); } - Save the Program.cs file.
Running the application
To run the application and create the PDF file, follow these steps:
-
In the integrated terminal, run the following command:
dotnet run - After running the application, you should see a new PDF file named sample.pdf in the project directory.
Conclusion
In this tutorial, you learned how to create a new .NET console application using .NET 8 or later and how to use the Server
Now you can use the TX Text Control SDK to create and manipulate documents in your .NET applications.
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
Version 33.0 Preview: NuGet Packages Explained and Why we Minimize Dependencies
This article explains the new NuGet packages for TX Text Control .NET Server and ASP.NET Core. We also explain why we minimize dependencies in our packages.
Building a TX Text Control Project with GitHub Actions and the Text Control…
This tutorial provides a step-by-step guide to setting up a clean, reproducible environment using GitHub Actions. It starts with a brand-new project and ends with a fully automated build and test…
ASP.NETASP.NET CoreDocument Editor
ASP.NET Core Document Editor with Backend via the Text Control Private NuGet…
This article demonstrates how to create a Document Editor ASP.NET Core application using the Text Control Private NuGet Feed. We will build a basic web application that enables users to edit…
Text Control Private NuGet Feed
The Text Control private NuGet feed delivers your licensed packages with zero friction. Your license is automatically embedded in every download. No manual license file management. No hunting for…
ASP.NETASP.NET CoreDocumentEditor
Document Editor with TX Spell .NET on Linux using ASP.NET Core
Learn how to integrate TX Spell .NET with the Document Editor on a Linux server using ASP.NET Core. This guide covers setup, configuration, and best practices for seamless spell checking…
