I’m running a .NET 6 application in a Windows 11 ARM virtual machine, and I’m trying to set up a Kafka subscriber using Confluent.Kafka. However, I keep getting this error:
services.AddSingleton<ISubscriber<string>>(new KafkaSubscriber<string>(
eventBusConfig.SubscriptionEngine, eventBusConfig.SubscriptionEngine.DeadLetterChannel));
It seems like the application can’t load the librdkafka native library, which is necessary for Kafka to function. I’ve already tried installing the correct NuGet packages, but the issue persists. My environment is ARM-based, and I suspect this might be an architecture issue.
Yes, this issue arises because ARM-based Windows doesn’t have native support for some x64-based libraries like librdkafka, which is what Confluent.Kafka depends on.
Since the librdkafka library is primarily built for x64 architecture, and it might not have ARM-native binaries, the solution is to run your application in x64 emulation mode on your ARM-based Windows device.
Windows 11 on ARM includes a feature called x64 emulation, which allows applications to run x64 code even on ARM architecture. Here’s how you can make your .NET application work in x64 mode: