Redis Docker Container Error ArgumentException: No endpoints specified (Parameter 'configuration')

Question: How do you solve the error that comes when you are trying to cache an object to Redis and the error says "ArgumentException: No endpoints specified (Parameter 'configuration')".

Answer: When working with Redis Docker Container in Asp.Net 5 Application, in order to connect to the external Redis Cache Server you will need to provide the Configuration Settings. The ConfigurationOptions requires the Endpoints to have two parameters, one is for the IP Address (Just IP Address, do not include HTTP or HTTPS) and the other one is for the port. Make sure you put all these settings in the appsettings.json and use the IConfiguration Interface to get the values from the file.

See the code below:

            services.AddStackExchangeRedisCache(options =>
            options.InstanceName = _configuration.GetValue<string>("NameOfInstanceHere");
            options.ConfigurationOptions = new ConfigurationOptions()
                EndPoints = { { _configuration.GetValue<string>("SettingsBlock:ConnectionString"), PortNumberComesInHere } },
                ConnectRetry = 2,
                ReconnectRetryPolicy = new LinearRetry(10),
                //Ssl = true,
                //AbortOnConnectFail = false,
                ConnectTimeout = 5000,
                //SyncTimeout = 1000,
                DefaultDatabase = 0,
                 Password = _configuration.GetValue<string>("Password")


Edit this Article
Redis Distributed Caching 5 Docker Docker published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy