# NuGet Authentication

> Solve problems with the Text Control Private NuGet Feed: 401 responses, expired API tokens, missing packages, an ignored nuget.config and build servers.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Troubleshooting > NuGet Authentication
- **1268 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/nuget-authentication/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/nuget-authentication/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/nuget-authentication/llms-full.txt

---

The Text Control Private NuGet Feed at `https://www.textcontrol.com/nuget/v3/index.json` checks every package request against your email address and API token. If a restore fails there, one of three things is usually wrong: the credentials, the serial numbers assigned to you or the *nuget.config* file NuGet reads. Each of them can go wrong on a developer machine as well as on a build server.

### The Feed Rejects Your Credentials

The restore of a TX Text Control package fails with the HTTP status 401 (Unauthorized) from a url that starts with `https://www.textcontrol.com/nuget/`.

The feed answers every package request with 401 when the credentials are missing or wrong. The service index itself is public, so NuGet reaches the feed, but can't download from it. The causes are:

- **The API token has expired or was deleted.** Tokens are valid for a limited time, and unassigning your last serial number that includes the feed deletes your token. See [Token Validity](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/api-token/#token-validity).
- **The credentials in *nuget.config* are wrong.** The user name is the email address your serial number is assigned to, the password is the API token, which starts with `ngt_`, and the element in `packageSourceCredentials` must have the name of the source, `TextControl`. See [File Structure](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/nuget-config/#file-structure).

To fix it, ask the account holder of your Text Control account to check the token in **Manage API tokens** and, if it has expired or is missing, to reassign a serial number to you or create a token, as [Manage Tokens](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/api-token/#manage-tokens) describes. Replace your *nuget.config* with the new one, and on a build server update the secret that holds the token.

### A Package or Version Is Not Listed

The source **TextControl** works, but a package such as `TXTextControl.TextControl.Core.SDK` or a version such as 34.0.5 doesn't appear.

The feed shows only the packages and versions you are licensed for. A package is listed when a serial number for its product is assigned to your email address, and a new major version is listed when your license covers it.

1. List what the feed offers you:

    ```bash
    dotnet package search "TXTextControl" --source TextControl
    ```
2. If the product is missing, ask the account holder to assign its serial number to you in **Manage Products**.
3. If a major version is missing, ask the [Text Control sales team](https://www.textcontrol.com/contact/) about your subscription.

Some packages, such as the Blazor components, are never on the private feed and come from nuget.org, as [The TX Text Control Package Is Not Found](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/installation/#the-tx-text-control-package-is-not-found) describes.

### You Have No nuget.config File

You have no *nuget.config* file for the feed, or can't find it. Text Control doesn't show the file in your account; it sends it by email when a serial number that includes the feed is assigned to you. Search your mailbox for the email that [What the Developer Receives](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/api-token/#what-the-developer-receives) describes, or ask the account holder to reassign a serial number to you.

### The Restore Ignores Your nuget.config

`dotnet restore` or Visual Studio doesn't use the feed, although *nuget.config* contains it.

NuGet reads *nuget.config* only from the folder of the solution and the folders above it; when you restore a project on the command line, the project folder counts as the solution folder. A `<clear />` element removes the sources defined before it, and a file passed with `--configfile` is the only one used. Move the file, or pass it with `dotnet restore --configfile path/to/nuget.config`. [Where to Put the File](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/nuget-config/#where-to-put-the-file) explains the rules, and why a web project must not have the file in its own folder.

### The Restore Fails on a Build Server

The build works on your machine, but the restore on the build server can't find the TX Text Control packages or gets a 401.

Your personal *nuget.config* is not in the repository, so the build server has no credentials. The pipeline has to write the file from secrets before the restore, as [CI/CD Authentication](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/ci-cd/llms-full.txt) shows for GitHub Actions, GitLab, Azure DevOps, Jenkins, Bitbucket and TeamCity; in Azure DevOps, the restore task has to use the generated file. Every later step that restores has to find the file as well: `dotnet publish` restores again for its runtime identifier, as [Publish for the Target Runtime](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/ci-cd/#publish-for-the-target-runtime) describes. In a Docker build, pass the file as a build secret; see [docker build Can't Restore the Packages](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/docker/#docker-build-can-t-restore-the-packages).

A build server needs no license of its own; the packages are licensed to the developers. See [Development Licenses](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/licensing/development/#build-servers-and-ci-cd).

### The API Token Was Shared by Mistake

The API token, or a *nuget.config* that contains it, was committed to a repository, sent to someone or published with an application. Ask the account holder to delete the token in **Manage API tokens** and create a new one, replace the file or the secret that holds it, and keep the file out of source control as [Keep Credentials Out of Source Control](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/nuget-config/#keep-credentials-out-of-source-control) describes. For Docker builds, add it to *.dockerignore* as well.

### Related Pages

- [Text Control Private NuGet Feed](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/llms-full.txt): set up the feed on a developer machine.
- [Installation](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/installation/llms-full.txt): packages that can't be found or installed for other reasons.
- [CI/CD](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/ci-cd/llms-full.txt): build and deploy an application in a pipeline.
- [Licensing](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/licensing/llms-full.txt): trial messages and license errors.

---

## Nearby

- **Previous:** [Installation](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/installation/llms-full.txt)
- **Next:** [Licensing](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/licensing/llms-full.txt)
