As the above warning indicates, keys must have stable hash codes. In .NET Core string hashes are not stable (by design).
Since strings are very commonly used as keys, was this addressed by the reliable collections runtime? It would be helpful to provide guidance here either way, and if necessary provide a sample of how to correctly use string keys in .NET Core.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks for the feedback! We are currently investigating and will update you shortly.
@TylerMSFT @aljo-microsoft is this something you could comment on?
@TylerMSFT @aljo-microsoft any update?
@MicahMcKittrick-MSFT - I have reached out to the product team. Responses may be delayed due to the team being at an offsite and we will all be at azure camp next week. Will respond when I have info to provide.
@TylerMSFT any update on this?
@aelij, the dev team took a look at their implementation and yes, strings can serve as durable keys for reliable collections.
Use the string itself as the key--do not use the result of .GetHashCode for the key.
I'll update the warning msg. in the doc.
I updated the warning msg. in the doc.
Most helpful comment
@aelij, the dev team took a look at their implementation and yes, strings can serve as durable keys for reliable collections.
Use the string itself as the key--do not use the result of .GetHashCode for the key.
I'll update the warning msg. in the doc.