I have a solution hosted in Azure that is using ServiceStack.Redis 2.0.601. App Services (Web API) and On-Premise windows services are all working as expected but the Cloud service worker roles are throwing binding errors.
I'm running the same code with same app configs in other type of projects and all working great
The code is very simple, Create a cloud service with one worker role. Add StachExchange.Redis nuget version 2.0.601 and try to connect a REDIS instance using the following line:
var connection = ConnectionMultiplexer.Connect(#ConnectionString#);
This is the only line I have in the code inside WorkerRole.OnStart Method.
System.BadImageFormatException: 'Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)'
I was getting similar errors, and realized I needed to add a bunch of additional Nuget packages.
User contributions licensed under CC BY-SA 3.0