1

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?

buzzard51
  • 1,372
  • 2
  • 23
  • 40
  • I cannot speak specifically about PCapDotNet, but you can use the [Fusion Log Viewer](https://learn.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer) to view assembly binding errors. It might help you determine which assembly it is failing on. – Chris Dunaway Jul 26 '17 at 14:15

1 Answers1

1

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!

buzzard51
  • 1,372
  • 2
  • 23
  • 40
  • Is this different from what the instructions say? https://github.com/PcapDotNet/Pcap.Net/wiki/Using-Pcap.Net-in-your-programs – brickner Jul 28 '17 at 04:01
  • @brickner I followed that instructions, still having the error comes up. Any other causes? – GeneCode Mar 01 '20 at 07:09