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?
I faced many troubles installing this tool, the only solution which worked for me was the one from @PAS, but only after adding the exact .Net Core version to the package installer.
Installing the latest one or even a slightly different one like 3.1.2 failed miserably.
So, the command line became :
dotnet tool install --global dotnet-sql-cache --version 3.1.0
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With