c#+linux+mono+Redis集群(解决无法连接Redis的问题)

在linux环境中使用mono来执行c#的程序,

在连接redis的时候遇到了无法连接数据库的错误。如下:

Unhandled Exception:
StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail.
  at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl (System.Func`1[TResult] multiplexerFactory, System.IO.TextWriter log) [0x0008f] in <3c6615c26745427097f34fa88a9ec796>:0
  at StackExchange.Redis.

在windows环境中测试正常,将程序迁入linux后发现此错误,经查找发现需要将使用的nuget包换成【StackExchange.Redis.Mono

更换后两个平台均运行正常。

posted @ 2018-08-13 16:59  Hey,Coder!  阅读(806)  评论(0编辑  收藏  举报