Hangfire: Mono: ws2_32.dll

Created on 4 Apr 2018  Â·  5Comments  Â·  Source: HangfireIO/Hangfire

I tried to configure a Nancy + Hangfire + OWIN + Hangfire + Hangfire.Redis.StackExchange app. This is the basic config:

using Hangfire;
using Owin;
using StackExchange.Redis;

namespace UBoot.Server
{
    public class Startup
    {
        public static ConnectionMultiplexer Redis;

        public void Configuration(IAppBuilder app)
        {
            GlobalConfiguration.Configuration.UseRedisStorage("localhost");

            app
                .UseNancy()
                .UseHangfireServer()
                .UseHangfireDashboard();
        }
    }
}

But when I run this application, all it does is keep printing the lines

ws2_32.dll
ws2_32.dll
ws2_32.dll
[...]

until I kill it. What could cause that and how do I fix it?

redis bug

Most helpful comment

Thanks @odinserj, just confirmed that it's working for me. 🎉

All 5 comments

The culprit was the Hangfire.Redis.StackExchange package, it should have been Hangfire.Redis.StackExchange.Mono.

I am also getting this issue with Mono but I'm not using Hangfire.Redis.StackExchange, I just have Hangfire.

ws2_32.dll gets logged repeatedly and my application never finishes starting. If I stop redis from running, I instead get the error ERROR|Hangfire.Pro.Redis.RedisStorage|Multiplexer disconnected: One or more errors occurred. (Could not resolve host 'redis'). Will reconnect in 00:00:30, but at least the application starts.

I will try to resolve this issue next week, by changing the socket manager implementation to not to use ws2_32 when running on Mono under Linux.

The problem is fixed in Hangfire.Pro.Redis 2.5.0 that will be released shortly – socket mode there is determined in run-time, instead of being defined statically. So it will not be using ws2_32 on non-Windows environments.

Thanks @odinserj, just confirmed that it's working for me. 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tompazourek picture tompazourek  Â·  3Comments

thurfir picture thurfir  Â·  4Comments

vikramjb picture vikramjb  Â·  3Comments

odinserj picture odinserj  Â·  4Comments

osmanrahimi picture osmanrahimi  Â·  3Comments