简体   繁体   中英

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?

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM