Issue: RdKafka setup is not finding/recognizing librdkafka in Visual Studio 15
Context:
In order to get started with RdKafka in visual studio 15, I ran the generic paket+nuget setup command (via powershell): paket add nuget rdkafka
After this, I see RdKafka has been installed successfully in my solutions package location. I also see a librdkafka package present.
Adding RdKafka as a reference in my solution works as well (I can't add the librdkafka dlls due to an error message from the IDE).
However, trying to run anything using librdkafka leads to a library not found.
What I've tried:
All the above to no success
Any suggestions on how to proceed?
So, it turns out someone else on my team figured out how to make this work, though admittedly it's a little bit of a hack. VS allows for pre-build events (Found by right clicking on your project > Properties > Build Events > Edit Pre-Build). And in there I dropped in the following:
{xcopy /y /d /f "$(ProjectDir)..\packages\RdKafka.Internal.librdkafka\runtimes\win7-x64\native*.*" "$(TargetDir)"}
And just like that, it works. The explanation for the above is that we pull the native dlls that cannot be referenced directly by copying them into our projects target directory just before the build is done. Hopefully, this helps some future folks, who don't consider rewriting the library into an referable form, like I did.