在C#Redis中:无法在127.0.0.1:6379连接到redis实例

时间:2015-08-13 15:10:41

标签: c# redis

使用Redis服务器时在C#中。我发起了redis服务器。

通过c#代码连接到redis服务器

我正在使用nuget包ServiceStack.Redis。

redisClient = new RedisClient("127.0.0.1", 6379);

例外:

  

base {“无法连接到redis实例   127.0.0.1:6379:6379“} System.Exception {ServiceStack.Redis.RedisException}

但我能够通过server_client.exe连接到服务器

我们是否需要做其他事情才能连接到redis?因为我是redis的新手。

1 个答案:

答案 0 :(得分:0)

如果你想在 127.0.0.1:6379 连接到redis-server,那么你需要Redis在本地运行redis-server

您可以通过在尝试与ServiceStack.Redis连接的同一服务器上运行redis-cli.exe来测试redis-server是否在本地运行。