WRONGTYPE Operation in StackExchangeRedis 6.0.1 with Redis 6.0.14

Viewed 193

I added the following key through the redis-cli:

redis.cache.windows.net:6379> set test hello
OK

Then, using StackExchangeRedis I'm trying to get the value:

await _cacheService.GetStringAsync("test");

where _cacheService is injected through IDistributedCache. I'm getting:

StackExchange.Redis.RedisServerException: WRONGTYPE Operation against a key holding the wrong kind of value

The type is a string, TYPE test returns "string" in Redis.

Update:

If I set the key through the code, it works:

await _cacheService.SetStringAsync("test", "hello");
// now GetStringAsync works
0 Answers
Related