liveBook · Manning

Dotnet-sql-cache package

As explained in Pro ASP.NET Core 7, Tenth Edition

The dotnet-sql-cache package is a .NET command-line tool package for creating and managing the database table used by SQL Server distributed caching.

The dotnet-sql-cache package installs the .NET command-line tool used to create the database table required by SQL Server distributed caching. It prepares the database; the ASP.NET Core application later consumes that table through SQL Server cache support. section 17.2.2

A practical setup sequence is:

  • Remove an existing global installation, then install the required tool version. section 17.2.2
  • Create or select the SQL Server database and run the tool with its connection string, schema, and cache-table name. section 17.2.2
  • Check for the successful table-and-index message before configuring AddDistributedSqlServerCache. section 17.2.2
Listing 17.9 Installing the SQL cache package
dotnet tool uninstall --global dotnet-sql-cache
dotnet tool install --global dotnet-sql-cache --version 7.0.0

Use the installation listing to reproduce the global tool setup, including the pinned 7.0.0 version. section 17.2.2

Listing 17.10 Creating the cache database table
dotnet sql-cache create "Server=(localdb)\MSSQLLocalDB;Database=CacheDb"
dbo DataCache

Use the table-creation listing to supply the SQL Server connection string and dbo DataCache destination. section 17.2.2

How Pro ASP.NET Core 7, Tenth Edition covers it

How deep it goes
Covers installation and table creation commands, but defers runtime cache configuration to a separate project package and service registration.
Examples
Uses SQL Server LocalDB, CacheDb, the dbo schema, and the DataCache table in its setup commands.
What it assumes
Assumes access to SQL Server or LocalDB and a usable database connection; addresses tool installation and database preparation directly.
What you can do after
Operate/configure the dotnet CLI tool to create the database table required by SQL Server distributed caching.
How it connects
Connects SQL Server distributed caching with connection strings, database schemas, cache tables, and ASP.NET Core service registration.

Also explained in

Compare how 2 books explain dotnet-sql-cache package →

This explainer was generated by Manning's knowledge graph from the text of Pro ASP.NET Core 7, Tenth Edition. The section links point to the parts of the book it draws on.