1
votes

We have an ASP.NET Forms application that was recently upgraded to .NET 4.6.2. We were using StackExchange.Redis.StrongName with Microsoft.AspNet.SignalR but recently moved to StackExchange.Redis. Prior to the .NET 4.6.2 upgrade, all was working with Redis but since the change, it doesn't seem that Redis is making a connection.

We have two nodes set up behind an ARR farm running the same application code.

Our Startup.cs file

using Microsoft.AspNet.SignalR;
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(MySampleProject.SignalR.Startup))]
namespace MySampleProject.SignalR
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            GlobalHost.DependencyResolver.UseStackExchangeRedis(RedisIP, 6379, RedisPassword, "MySampleProject");
            app.MapSignalR("/signalr", new HubConfiguration
            {
                EnableJavaScriptProxies = true,
                EnableDetailedErrors = true,
                EnableJSONP = true
        });
        }
    }
}

The only thing that's changed in our Startup.cs file is the use of UseStackExchangeRedis from UseRedis with the StackExchange.Redis.StrongName package.

We have Redis 6.0.10 installed on a CentOS 7 box.

If we revert back to using StackExchange.Redis.StrongName everything works again.

If we comment out

GlobalHost.DependencyResolver.UseStackExchangeRedis(RedisIP, 6379, RedisPassword, "MySampleProject");

SignalR works but messages are (obviously) only passed through on the same server.

We followed the instructions at https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis.

Are there any other configuration changes that need to be made?

1

1 Answers

0
votes

I found another post running into a similar issue: Signalr using Redis backplane not propagating message

The solution was to enable tracing in Signalr: https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/enabling-signalr-tracing

Finding "Error connecting to Redis - System.InvalidOperationException: The assembly for System.IO.Piplines could not be loaded"

The following was added to the Web.config

      <dependentAssembly>
        <assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.1" />
      </dependentAssembly>

And it resolved the issue.