使用redis背板的信号器不传播消息

vlurs2pr  于 2021-06-09  发布在  Redis
关注(0)|答案(1)|浏览(432)

我有一个.net 4.5 mvc应用程序,我最近转移到aws,所以我们需要添加一个背板到我们的信号器实现。我已经遵循了会议概述的步骤https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis. 我已安装nuget软件包,当前配置如下所示:

[assembly: OwinStartup(typeof(SignalrBootstrapper))]
namespace app
{
    public class SignalrBootstrapper
    {
        public void Configuration(IAppBuilder app)
        {
            var scaleoutConfig = new RedisScaleoutConfiguration(ConnectionStrings.Redis, "appSignalrBackplane");
            GlobalHost.DependencyResolver.UseStackExchangeRedis(scaleoutConfig);

            // Any connection or hub wire up and configuration should go here
            app.MapSignalR();
        }
    }
}

然而,它似乎不起作用。推送通知不再发送,我尝试使用redis cli手动订阅频道,但没有发布任何内容。没有错误,我已尝试将连接详细信息手动输入到 UseStackExhangeRedis 函数而不是使用 RedisScaleoutConfiguration 在演示链接,但它没有帮助。

balp4ylt

balp4ylt1#

最后,我找到了一种在signar中启用跟踪的方法:https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/enabling-signalr-tracing
使用跟踪,我发现加载dll时出错 Error connecting to Redis - System.InvalidOperationException: The assembly for System.Numerics.Vectors could not be loaded ,所以我添加了一个指向web.config的重定向,解决了这个问题

<dependentAssembly>
    <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>

相关问题