ServiceStack.Redis 5.11.1 Exception

We are using 5.11.1 because of some changes in dart dto generation.

if we use 5.11.1 we get an exception when we try to register RedisMqServer:
var mqHost = new RedisMqServer(host.Container.Resolve<IRedisClientsManager>());

System.TypeLoadException: Method 'get_OnEvent' in type 'ServiceStack.Redis.RedisPubSubServer' from assembly 'ServiceStack.Redis, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at ServiceStack.Messaging.Redis.RedisMqServer..ctor(IRedisClientsManager clientsManager, Int32 retryCount, Nullable`1 requestTimeOut)
1 Like

Whenever you get Type or Missing method exceptions from using the pre-release packages you’ll need to delete your NuGet packages cache:

$ nuget locals all -clear

Then restore your packages again.

i tried that already, unfortunately it didn’t work.

it’s also weird since if i dig into the decompiled-dll with rider, the OnEvent property is there. i don’t really understand whats not working.

Sounds like you still have dirty dlls of different versions, try deleting your /bin and /obj folders in all your projects.

i did that too.

if nuget is configured with myget, reprosteps:

  • nuget locals all -clear
  • x new empty
  • x mix redis
  • e.g. in Configure.Redis.cs: add in Configure(IAppHost appHost)
  • var pubsub = new RedisPubSubServer(appHost.Resolve<IRedisClientsManager>());
    

it will throw then the type load exception on startup.

I’ve rebuilt all packages in CI, can you try clearing the nuget packages cache and trying again?

1 Like

awesome, works now!

thank you!

1 Like