While connecting to Redis in .net core getting error

Viewed 58

This is error statement..

{"The assembly for System.Runtime.CompilerServices.Unsafe + System.Runtime.CompilerServices.Unsafe could not be loaded; this usually means a missing assembly binding redirect - try checking this, and adding any that are missing; note that it is not always possible to add this redirects - for example 'azure functions v1'; it looks like you may need to use 'azure functions v2' for that - sorry, but that's out of our control"}

I am using .net core and C# while connecting to Redis can any one help me with this issue or let me know if some extra data is required.

My code

ConnectionMultiplexer redis = 
         ConnectionMultiplexer.Connect(connectionString);

IDatabase db = redis.GetDatabase();

web.config

<dependentAssembly>
    <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
  </dependentAssembly>

NOTE: It is working fine on my local machine while deploying on UAT it not working fine

Edit:

  1. When I depreciate the stackExchange.Redis 2.6.x-> 2.1.x/2.2.x and System.Runtime.CompilerServices.Unsafe 5.0.0-> 4.7.x Redis is getting connected but mySql won't.
  1. I have installed redis on windows using .msi file. So, might be possible that lower version is getting installed.
0 Answers
Related