I have the following piece of code to connect to azure redis cache.
public class CacheConnectionHelper
{
private static Lazy
The error you are getting is usually a sign that you have not set abortConnect=false in your connection string. The default value for abortConnect is true, which makes it so that StackExchange.Redis won't reconnect to the server automatically under some conditions. We strongly recommend that you set abortConnect=false in your connection string so that SE.Redis will auto-reconnect in the background if a network blip occurs.
This problem was solved in a new release, the version 1.2.6 - you can see in Here
For me, the connection string was incorrect. Adding the correct connection string details worked with stackexchange.redis 2.1.58
For those maintaining older codebases, you may run into "It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING"
Once I upgraded to a more recent nuget package the error was still present but I got more error information: "The client and server cannot communicate, because they do not possess a common algorithm".
Once I applied the registry keys mentioned here I was ok. For those that don't wish to make that global change I believe there has been a PR for a setting.
for beginners who dive in other's code an face this problem:
if (RedisConn == null)
{
ConfigurationOptions option = new ConfigurationOptions
{
AbortOnConnectFail = false,
EndPoints = { redisEndpoint }
};
RedisConn = ConnectionMultiplexer.Connect(option);
}
I fixed this by changing my connection string from localhost:6379 to 127.0.0.1:6379