[英]Errors when trying to use StackExchange REDIS in Azure Cloud Service Worker Role
I have a solution hosted in Azure that is using ServiceStack.Redis 2.0.601.我有一个托管在 Azure 中的解决方案,它使用 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.
应用服务 (Web API) 和本地 windows 服务都按预期工作,但云服务工作者角色正在引发绑定错误。
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.代码很简单,创建一个只有一个worker角色的云服务。 Add StachExchange.Redis nuget version 2.0.601 and try to connect a REDIS instance using the following line:
添加 StachExchange.Redis nuget 版本 2.0.601 并尝试使用以下行连接 REDIS 实例:
var connection = ConnectionMultiplexer.Connect(#ConnectionString#);
This is the only line I have in the code inside WorkerRole.OnStart Method.这是我在 WorkerRole.OnStart 方法内的代码中唯一的一行。
System.BadImageFormatException: 'Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. System.BadImageFormatException:'无法加载文件或程序集'System.Memory,版本 = 4.0.1.0,文化 = 中性,PublicKeyToken = cc7b13ffcd2ddd51'或其依赖项之一。 Reference assemblies should not be loaded for execution.
不应加载引用程序集以供执行。 They can only be loaded in the Reflection-only loader context.
它们只能在 Reflection-only loader 上下文中加载。 (Exception from HRESULT: 0x80131058)'
(来自 HRESULT 的异常:0x80131058)'
I was getting similar errors, and realized I needed to add a bunch of additional Nuget packages.我遇到了类似的错误,并意识到我需要添加一堆额外的 Nuget 包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.