Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing assembly binding redirect from StackExchange.Redis 2.0.513 package

I am getting the following exception when trying to use the latest Nuget package StackExchange.Redis in Cloud Service for .Net 4.7

System.InvalidOperationException: The assembly for System.Buffers and System.IO.Pipelines 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 at Pipelines.Sockets.Unofficial.Helpers.g__Throw|5_0(String msg) at Pipelines.Sockets.Unofficial.Helpers.AssertDependencies() at StackExchange.Redis.ConnectionMultiplexer.Connect(String configuration, TextWriter log) at ...

This is coming from a Worker Role in Cloud Service, which is referencing to a class library referencing to this package. Also, I am not able to reproduce this locally. It happens only after deployment to the VM/Cloud Service.

What am I missing?

like image 215
Minhaz Avatar asked Nov 22 '18 11:11

Minhaz


Video Answer


1 Answers

Add assembly redirect:

<dependentAssembly>
    <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" />
    <bindingRedirect oldVersion="4.0.2.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>

Found the details here.

like image 95
Aryéh Radlé Avatar answered Oct 21 '22 10:10

Aryéh Radlé