I have an asp net core app with a few Microsoft packages.
Microsoft.AspNetCore.DataProtection.StackExchangeRedis depends on StackExchange.Redis
Microsoft.Extensions.Caching.Redis depends on StackExchange.Redis.StrongName
Whenever I try and reference anything in the StackExchange.Redis namespace it causes a CS0433 error.
How can I resolve this?
Thanks.
Unfortunately, this is part of the pain of removing StrongName and removing the pain long-term. The only fix available here is to wait for .NET Core 3.0. It will use the 2.x StackExchange.Redis (which is strong named).
If your case, Microsoft.AspNetCore.DataProtection.StackExchangeRedis
has already upgraded but the other lib has not. It's going in-framework and getting that upgrade in 3.0. We should be about 2 months away from the 3.0 release (.NET Conf in late September). Since this lib has a 2.0 minimum though (as far back as NuGet goes), I don't have a workaround which would normally consist of using an older version for 1 of the 2 libraries.
Oh dear, looks like my only real option is to clone Microsoft.Extensions.Caching.Redis and update it myself. I have been using StackExchange.Redis for many years, good to know it's going in-framework for 3.0.
For anyone else with this problem, Microsoft.Extensions.Caching.Redis has now been replaced by Microsoft.Extensions.Caching.StackExchangeRedis, solving the conflict.
Closing out to cleanup, thanks for the update @Herostwist!
Most helpful comment
For anyone else with this problem, Microsoft.Extensions.Caching.Redis has now been replaced by Microsoft.Extensions.Caching.StackExchangeRedis, solving the conflict.