.NET CLI
With the .NET CLI, you use the Text Control Private NuGet Feed from a terminal, for example with Visual Studio Code, on Linux or on a build server. A few commands find the packages you are licensed for, add them to a project and restore them.
Before You Begin
- The .NET 8 SDK or higher.
- Your personalized
nuget.configfile. See Creating an API Token. - Copy
nuget.configto your project directory. When you restore a project on the command line, NuGet treats the project directory as the solution directory and reads the file from there. See nuget.config.
Search for Packages
List the packages that your license gives you access to:
dotnet package search "TXTextControl" TextControl
--source TextControl limits the search to the package source with the key TextControl in nuget.config. The results show the package ID, the latest version, the owner and the number of downloads for each package.
The search results show only the packages you are authorized to use. This is by design, so there is no confusion about what you may use. For example, a developer who is licensed for TX Text Control .NET Server and TX Text Control .NET for WPF sees TXTextControl.TextControl.ASP.SDK, TXTextControl.TextControl.Core.SDK, TXTextControl.TextControl.WPF.SDK and the web packages, but not TXTextControl.TextControl.WinForms.SDK.
Add a Package
Add a package to the project in the current directory:
dotnet add package TXTextControl.TextControl.Core.SDK
NuGet retrieves the package from the private feed with the credentials in nuget.config. On the server, the license is injected into the package before the download, so the package is ready to use immediately.
To install a specific version, add the --version option. The command adds a package reference with this version to the project file:
dotnet add package TXTextControl.TextControl.Core.SDK 34.0.5
Package Versioning explains the version numbers and which versions belong together.
Add the Packages for a Scenario
Most applications need more than one package. For an ASP.NET Core application with the Document Editor, run the following commands in the project folder:
dotnet add package TXTextControl.Web
dotnet add package TXTextControl.TextControl.Core.SDK
dotnet add package TXTextControl.Web.DocumentEditor.Backend
Packages that are published on nuget.org, such as TXTextControl.Web.Blazor.DocumentEditor, are installed with the same command, as long as nuget.org is one of your package sources, as in the file structure shown in nuget.config. Package Overview lists the packages for each scenario.
Restore and Build
dotnet build and dotnet run restore missing packages automatically. On a build server, restore the packages in a separate step and then build without restoring again:
dotnet restore
dotnet build Release
If the configuration file is not in the project or solution folder, pass it explicitly. NuGet then uses only the settings from this file:
dotnet restore path/to/nuget.config
The commands work the same way on Windows and Linux. Most of Text Control's CI/CD examples run them on Linux build agents. See CI/CD Authentication.
Next Steps
- Create Your First Application — create a console application with the .NET CLI.
- CI/CD Authentication — restore packages in a build pipeline.
- Package Versioning — pin versions and keep packages together.
- NuGet Authentication — solve problems with the feed.