2

Using PcapDotNet library from Github (https://github.com/PcapDotNet/Pcap.Net/wiki/Using-Pcap.Net-in-your-programs), I built a Windows Service that allows remote network sniffing for comms network troubleshooting. After deployment the service is unable to start.

On startup the Windows Event Log shows:

Service cannot be started. System.IO.FileNotFoundException: Could not load file or assembly 'PcapDotNet.Core.dll' or one of its dependencies. The specified module could not be found.
File name: 'PcapDotNet.Core.dll' at NewPcapService.svcPcapServer.ServiceStart

Following the guidelines in the pcapDotNet wiki page above, I built the project in release mode, and installed all the redistributable packages recommended.

The 'missing' file, PcapDotNet.Core.dll, is located with 3 other PcapDotNet DLLs in the same folder as the service EXE.

I also put a copy of all 4 DLLs in the Windows and Windows\System32 folders, all to no avail.

Can anyone help on this one? This library is at the core of some essential network tests we are designing for system troubleshooting.

buzzard51
  • 1,372
  • 2
  • 23
  • 40

2 Answers2

2

Note that probably the file is not 'missing', but "one of its dependencies" probably is.

This is basically question 6 in the Pcap.Net FAQ.

Please make sure you follow all steps in Using-Pcap.Net-in-your-programs guide as it most likely will resolve your issue, like it did for several people before.

brickner
  • 6,595
  • 3
  • 41
  • 54
  • 1
    "Following the guidelines in the pcapDotNet wiki page above, I built the project in release mode, and installed all the redistributable packages recommended." Also I should mention that this service works fine on my development machine, but does not work on the target host. Right now I'm investigation problems with different .NET Frameworks or 32/64 bit targets. – buzzard51 Sep 11 '18 at 20:10
0

Although (I thought) I followed the recommendations in Using-Pcap.Net-in-your-programs guide, I was still missing a redistributable package for x86. I had skipped it because the target host is a 64-bit machine.

For simplicity, I installed all recommended VC++ packages via command line:

vcredist_x86_2010.exe /passive /norestart
vcredist_x64_2010.exe /passive /norestart
vcredist_x86_2013.exe /install /passive /norestart
vcredist_x64_2013.exe /install /passive /norestart

Now the application works fine.

buzzard51
  • 1,372
  • 2
  • 23
  • 40