Redis and Core 2.2 - Solution

1 year ago
We found that was using an older StackExchange.Redis library on the nuget package 2.2.0.

There is a bug in the StackExchange.Redis library, and it causes timeouts, locks, all kinds of issues.

If you need to fix this now, here is what we did:

1. Checkout the code from github:
2. Open the code, and update-packages in the nuget console.  (Or probably through the UI as well )
3. This should update your StackExchange.Redis to the latest version: 2.0.601
   <PackageReference Include="StackExchange.Redis" Version="2.0.601" />
4. Build the release version.
5. Copy the dlls of the release into a directory in your solution.
6. Remove RedLock in NOP and add in the compiled version you created.

7. Now there is a conflict with Microsoft.AspNetCore.DataProtection.Redis v.0.4.1, remove it.
8. Add Microsoft.AspNetCore.DataProtection.StackExchangeRedis v2.2.0
9. Now modify Nop.Web.Framework/Infrastructure/Extensions/ServiceCollectionExtension.cs:
   remove - services.AddDataProtection().PersistKeysToRedis()
       to - services.AddDataProtection().PersistKeysToStackExchangeRedis(() =>

That should do it!

I hope that helps someone else.
1 year ago
Fail.   We thought this worked, but after load testing, we realized we still get the timeouts.