-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Member 'EndPoints' cannot be initialized. It is not a field or property. #2238
Comments
Hmm; I suspect you're using a pretty old C# compiler - it looks like the addition of Does it work if you do: _configurationOptions = new ConfigurationOptions
{
Password = argStrPassword,
AbortOnConnectFail = false,
KeepAlive = 30,
ConnectTimeout = 2 * 60 * 1000, // in millisond defulat 5 sec , currently changed to 2 minute
SyncTimeout = 2 * 60 * 1000, // in millisond defulat 5 sec , currently changed to 2 minute
Ssl = argSsl
};
_configurationOptions.EndPoints.Add(argStrEndPoints); ? As side notes:
|
Hello @mgravell , Now we have moved our library class to .Net 6.0(VS 2022) and as a result, we are able to work with StackExchange.Redis v2.6.48. Regarding your other suggestions/side notes, if we change "static" to "readonly", we are not allowed to assign any value. I have shared my connection code above, can you let me know the correct way to connect with redis, or point me in right direction/reference documents so that I may avoid any future issues? Thanks |
There is no single definition of correct - everything in programming is contextual. However: a static field assigned in an instance constructor would usually be wrong - that means if you create 42 objects, they're all sharing the same field |
Hi @mgravell, Thank you for the suggestions. There is another thing we have noticed after we updated our StackExchange.Redis package to version 2.6.48, the first call to redis always takes a lot of time(approx 2min 15sec) when the redis we are trying to connect to has "SSL=True" and all the subsequent calls are fast, This was not the case with older version of StackExchange.Redis(v 2.1.58). Is there anything else we should be aware of? Thanks, |
Hello, About the other issue, we've noticed the first connection to redis sometimes takes very long. As @vxsaurabh-s mentioned it can be in the ranges of 2 to even 4 minutes, which causes some of our systems to timeout. |
On the connection issue, version 2.6.70 is on MyGet which hopefully resolves the connection duration - if you're able to confirm that fixes your other issue I'd hugely appreciate it. |
Alrighty, since the first issue was compiler and second is now on NuGet with the connection fix (2.6.70) going to tidy up here. If that library update doesn't solve the second issue of using the full timeout please comment and we'll definitely reopen to poke! |
Hi
Server - AWS Elastic Cache Cluster mode with 2 nodes
Engine - 6.2.5
Client - StackExchange.Redis 2.1.58
This is our code which had been working until recently.
But since we updated our StackExchange.Redis package to version 2.6.48, we are getting this error message :Member 'EndPoints' cannot be initialized. It is not a field or property.
Is there any logic change to the way we connect to redis, or is there is any alternative to this?
The text was updated successfully, but these errors were encountered: