Hangfire.Redis.StackExchange
Hangfire.Redis.StackExchange copied to clipboard
Please update StrongName nuget package to same as non-signed one
subj, cant use non-strongname one because of Signalr.redis
+1, because Microsoft.AspNetCore.All => Microsoft.Extensions.Caching.Redis (2.0.1) => StackExchange.Redis.StrongName (1.2.4)
The problem also occurs when using the Microsoft.AspNetCore.App
package, which is now included by default in ASP.NET Core 2.1 projects.
A fix to this issue would be much appreciated.
I think this update is important because of the backwards-incompatible nature of the SE.Redis update I talked about in https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/pull/78#issuecomment-429915281
I'm on ASP.NET Core 2.1.x don't want to upgrade fully to SE.Redis 2.x yet, but I would like the fixes from the latest version of this package :)
In the meantime, I am using this as a workaround (add it as a child beneath the <Project>
tag):
<Target Name="ChangeAliasesOfStrongNameAssemblies" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
<ItemGroup>
<ReferencePath Condition="'%(FileName)' == 'StackExchange.Redis.StrongName'">
<Aliases>signed</Aliases>
</ReferencePath>
</ItemGroup>
</Target>
This fixes the build errors, but causes any file that has using StackExchange.Redis
to give this Intellisense error:
The type 'ConnectionMultiplexer' exists in both 'StackExchange.Redis.StrongName, Version=1.2.6.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46' and 'StackExchange.Redis, Version=1.2.6.0, Culture=neutral, PublicKeyToken=null'
If we are able to upgrade to the latest version of the strongname version of this package, the issue will go away completely.
Update: I was able to fix this by referencing Microsoft.AspNetCore.App
instead of Microsoft.AspNetCore.All
as suggested in https://github.com/StackExchange/StackExchange.Redis/issues/697#issuecomment-391131108
After I did that I had to add in a few dependencies I was missing that were in .All
but not .App
. After that, I was able to remove the .csproj
fix I posted above because I wasn't using any of the ASP.NET Core features that depended on SE.Redis and now I only had the non-StrongName reference.
Anyone who uses SignalR, etc will still need that fix.
https://www.nuget.org/packages/Microsoft.Extensions.Caching.StackExchangeRedis/ https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.StackExchangeRedis/ @alecgorge @sebastianbk @gzpbx @xumix