Creating ASP.NET Core SQL Cache table

David

I'm trying to generate the Distributed SQL Server Cache for ASP.NET Core 2.0, using the CLI, but I only get an error. The instructions say to execute

dotnet sql-cache create <connection string>  <schema>  <table name>

but when I do, it simply responds with No executable found matching command "dotnet-sql-cache".

I have installed Microsoft.Extensions.Caching.SqlConfig.Tools 2.0.0 on that project. So it should work from the project root, no?

When I execute dotnet -h, I get .NET Command Line Tools (2.0.2), etc. Surprisingly enough, sql-cache is not listed there among the SDK commands, alongside new, restore, run, migrate, etc. Shouldn't it be?

sjgallen

I have found installing certain Tools to be troublesome when I have used Nuget either by using the CLI or the package manager. In the past I have had to directly install a tool in the csproj file. Check your csproj file and see if the installation of the SqlConfig took hold. If it has not just add it and run a dotnet restore. Here is an example of how to "hard code" the tool. ```

<ItemGroup>
<DotNetCliToolReference 
     Include="Microsoft.Extensions.Caching.SqlConfig.Tools" 
     Version="2.0.0" />
</ItemGroup>

Also, here is a link to where a better explanation to the issue. It also recommends installing Microsoft.Extensions.Caching.SqlServer if you have not already done so but I would try this solution first. Hope this helps.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ASP.NET Core ApiAuthorizationDbContext not creating table for data model

ASP.NET Core distributed cache with Redis or SQL Server

SQL distributed cache created on Asp.net core startup

Creating unique column in .sql script (asp.net core)

.Net core SQL cache dependency

Creating a record in one table will update an existing record in another table ASP.NET Core MVC

Display contents of SQL Table with Asp.Net Core MVC and FullCalendar

Add Cache to ASP.NET Core response

Redis Cache in ASP.NET Core

How to cache resources in Asp.net core?

Asp.Net Core Cache Tag Helper

ASP.Net Core PWA Cache Query

Creating a session in ASP.NET Core 3.1

Creating an ASP.NET Core project

Can I use In-Memory Engine for SQL Server Distributed Cache in ASP.NET Core?

ASP.NET Core / Entity Framework - HTTP Post not creating entities in join table when using many-to-many relationship

ASP .NET Core and Azure Table Storage

Asp.net core - no such table: AspNetUsers

ASP.NET Core Custom Authorization & Memory Cache

How to retrieve a list of Memory Cache keys in asp.net core?

Response cache not working in asp.net core project

ASP .NET Core: How to cache data which depend on user input?

ASP.NET CORE use MemoryCache or similar for send copy of Cache

ASP.NET Core remove cache entry at a given time

ASP .NET Core using InMemory Cache per user

Programmatically clear cache profile in asp.net core

Asp.net core, what is difference between cache Taghelper and IMemoryCache?

How to cache css,js or images files to asp.net core

Implement HTTP Cache (ETag) in ASP.NET Core Web API