TX Sheet Control

Install the NuGet Packages

Topic

The three .NET packages of TX Sheet Control, TXTextControl.TXSheetControl.AspNetCore, TXTextControl.TXSheetControl.Blazor and TXTextControl.TXSheetControl.Server, are not on nuget.org. You install them from the Text Control Private NuGet Feed, with the nuget.config file from your assignment email, or from the nuget folder of the download. Both deliver the same packages.

SourceUse it when
The Text Control Private NuGet FeedYou develop with a developer or trial serial number. This is the recommended way: Visual Studio, the .NET CLI and build servers restore from it like from any other feed.
The nuget folder of the downloadYou cannot use the feed, for example because your network allows only nuget.org or an internal mirror, or because you have no nuget.config.

Whichever source you use, keep nuget.org enabled: the Server package depends on Microsoft.ClearScript.V8 and Sodium.Core, and the Blazor package on Microsoft.AspNetCore.Components.Web, which NuGet restores from nuget.org.

Install From the Private NuGet Feed

The nuget.config File

The NuGet button of your assignment email downloads a nuget.config file that is generated for you:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="TextControl" value="https://www.textcontrol.com/nuget/v3/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <TextControl>
      <!-- This is the assigned developer's email address. -->
      <add key="Username" value="developer@example.com" />
      <!-- This is the assigned developer's API token. -->
      <add key="ClearTextPassword" value="ngt_..." />
    </TextControl>
  </packageSourceCredentials>
</configuration>
  • Package sources. The file adds two sources: nuget.org and the Text Control feed, named TextControl. <clear /> removes the sources that other configuration files define, so if your projects also use a company feed, add it to this file as another <add> line.
  • Credentials. The feed authenticates with your email address as the user name and your personal API token as the password. The token is only in this file and is not shown anywhere else.
  • Packages. The feed lists the packages and major versions that the serial numbers assigned to your email address license, also those of other Text Control products.

Put the File in Place

  1. Copy nuget.config into the folder of your solution file, or the folder of your project file if there is no solution. NuGet reads it from there and from every parent folder.
  2. Keep the file out of source control, because it contains your token. In Git, add nuget.config to .gitignore, or keep the file in a parent folder outside the repository.

Install a Package

With the .NET CLI, run dotnet add package in the project folder:

dotnet add package TXTextControl.TXSheetControl.AspNetCore --version 2.0.0

Use TXTextControl.TXSheetControl.Blazor for Blazor and TXTextControl.TXSheetControl.Server for backend processing.

In Visual Studio, right-click the project, choose Manage NuGet Packages, select the TextControl package source and install the package. Visual Studio reads the same nuget.config.

The packages require acceptance of their license agreement, LICENSE.txt, the license agreement of TX Sheet Control: Visual Studio asks you to accept it when you install a package.

Token Validity

An API token that is created by assigning a serial number is valid for 365 days. Assigning or reassigning a serial number to you extends it. When your token has expired, or the file holds a wrong token, restore fails with error NU1301 and Response status code does not indicate success: 401 (Unauthorized). Ask the account holder to reassign your serial number to you in Manage products, and use the nuget.config from the new email.

The token is not stored anywhere else, so it cannot be shown again. While a token is valid, reassigning a serial number only extends it and sends no new nuget.config. If you have lost the file, or if the token was shared by mistake, ask the account holder to delete the token in Manage API tokens and to create a new one there, which sends you a new nuget.config. Treat the token like a password.

A serial number for unlimited deployment (OEM) gives no access to the feed. Developers install the packages with their developer serial numbers.

Install From the nuget Folder

Add the nuget folder of the download as a package source, next to nuget.org, and install the package by name:

dotnet nuget add source /path/to/TX-Sheet-Control-2.0/nuget --name TXSheetControl
dotnet add package TXTextControl.TXSheetControl.Server --version 2.0.0

dotnet nuget add source writes the source into the nearest nuget.config in the current folder or its parents, or into your user-wide NuGet configuration when there is none. To choose the file, add --configfile with its path. A nuget.config that starts with <clear /> must list nuget.org and the folder itself.

Do not use dotnet add package --source /path/to/nuget for the Server and Blazor packages. The --source option replaces all other sources, and the restore fails with error NU1101 because the dependencies on nuget.org are not found.

Install the Blazor Packages

For a Blazor Server application that shows the editor and processes documents on the server:

dotnet add SheetServer/SheetServer.csproj package TXTextControl.TXSheetControl.Blazor --version 2.0.0
dotnet add SheetServer/SheetServer.csproj package TXTextControl.TXSheetControl.Server --version 2.0.0

For Blazor WebAssembly with a separate backend:

dotnet add SheetClient/SheetClient.csproj package TXTextControl.TXSheetControl.Blazor --version 2.0.0
dotnet add SheetApi/SheetApi.csproj package TXTextControl.TXSheetControl.Server --version 2.0.0

An application that only shows the editor installs the Blazor package alone. Choose a Package shows which project needs which package.

Build Servers

A build server restores the packages like your development computer:

  • Private feed. Add the feed with the credentials of a developer from a secret of your build system, instead of a nuget.config in the repository:

    dotnet nuget add source https://www.textcontrol.com/nuget/v3/index.json --name TextControl --username "$TX_NUGET_USER" --password "$TX_NUGET_TOKEN" --store-password-in-clear-text
    
  • Package folder. Store the three .nupkg files in a folder of the repository or on an internal feed, and add that folder or feed as a package source.

What the Packages Add to Your Build

  • ASP.NET Core and Blazor. The editor script, fonts and language files are static web assets. Build and dotnet publish include them in the application automatically; you do not copy them by hand.
  • Server. The build and dotnet publish copy the engine, its fonts and notices into a tx-sheet-engine folder in the output. Deploy this folder with the application and do not serve it as public web content. The package also brings the native V8 libraries for Windows, Linux and macOS on x64 and Arm64.

Update to a New Release

The three NuGet packages of a release share one version number. Update every TX Sheet Control package of a solution to the same version:

dotnet add package TXTextControl.TXSheetControl.Server --version 2.0.1

Use the version number of the new release; 2.0.1 is an example. In Visual Studio, the Updates tab of Manage NuGet Packages lists the new version. From the private feed, your license covers every 2.x release. From the nuget folder, add the nuget folder of the new download as the package source first.

Next Steps