.netredisservicestackredis-sentinelservicestack-bsd

Could not load type 'ServiceStack.Redis.RedisSentinel' from assembly 'ServiceStack.Redis, Version=3.9.48.0, Culture=neutral, PublicKeyToken=null


Currently in my application I am trying to implement application caching for which I have used RedisSentinel.

We have a common assembly which is having all code and configurations implemented for Redis, and that assembly is having ServiceStack version 4.5.4.

I am referring the same assembly (DLL) in my project, but we are having ServiceStack 3.9.48 and currently no plans to upgrade it.

While trying to access instance of RedisSentinel, I am getting following error:

Could not load type 'ServiceStack.Redis.RedisSentinel' from assembly 'ServiceStack.Redis, Version=3.9.48.0, Culture=neutral, PublicKeyToken=null

Can anyone please guide how to resolve this issue?

The ultimate goal is to use RedisSentinel in my application which is using ServiceStack 3.9.48, and I would prefer to access the above mentioned custom assembly which we are already referencing in other projects.

Any help on this will be much appreciated.

Thanks


Solution

  • an anyone please guide how to resolve this issue?

    Options:

    Basically, you can only load one version of the dll into an app-domain. If you reference both 4.5.4 and 3.9.48 then what happens at runtime depends on which version loads, i.e. which version you ship in your package.

    In the general case, I would advise "use the newer", as it may contain bug-fixes for features that existed in 3.9.48 that you are using. Of course, newer code can also just mean new bugs :)