buzzard51
buzzard51

Reputation: 1467

PcapDotNet only runs on development machine

I'm using the PcapDotNet Library (https://github.com/PcapDotNet/Pcap.Net/wiki) to build a protocol-specific remote sniffer for a private network.

I can include the DLLs in Visual Studio 2017 in a C# application, and it runs fine. There are 5 PCAP DLLs required for the application at runtime.

The problem is when I move the application and the DLLs to another host on the network; the application throws a 'file not found' exception even though the DLLs are in the same folder as the EXE. I think this might be a catch-all error code and the real problem is with dependencies inside the PCAP library.

The only difference I can find between the development host and the deployment host is the Visual Studio environment. I've tried several fixes on the development side, including trying to rebuild the PCAP library from source (still has file-not-found issues) and targeting different platforms (x86, x64, any) but always get the same result. Has anyone run into this problem?

Upvotes: 1

Views: 524

Answers (1)

buzzard51
buzzard51

Reputation: 1467

A colleague at work found the solution for this: PcapNet.Core.DLL is built with C++, and has a dependency on the Visual C++ Redistributable library. So for PcapDotNet to work, you must install the redistributable on the target machine. The x86 version is the one to use:

vcredist_x86.exe

Once this was run, my PcapDotNet applications worked fine. Thanks BC for your efforts!

Upvotes: 1

Related Questions