Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I am using Microsoft.Extensions.Caching The following error occurred during StackExchangeRedis.
StackExchange.Redis.RedisServerException:“ERR unknown command”
Expected Behavior
No response
Steps To Reproduce
https://raw.githubusercontent.com/microsoft/garnet/main/docker-compose.yml
services:
garnet:
image: 'ghcr.io/microsoft/garnet'
ulimits:
memlock: -1
ports:
- "6379:6379"
# To avoid docker NAT, consider `host` mode.
# https://docs.docker.com/compose/compose-file/compose-file-v3/#network_mode
# network_mode: "host"
volumes:
- garnetdata:/data
volumes:
garnetdata:
using Microsoft.Extensions.Caching.Distributed;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = "localhost:6379";
options.InstanceName = "garnet";
});
var app = builder.Build();
IDistributedCache distributedCache = app.Services.GetRequiredService<IDistributedCache>();
distributedCache.SetString("test", "hello garnet");
var value = distributedCache.GetString("test");
if (value != "hello garnet")
{
throw new Exception();
}
app.Run();
Exceptions (if any)
No response
.NET Version
dotnet 8
Anything else?
No response