Reputation: 1467
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.
Upvotes: 2
Views: 11225
Reputation: 1467
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.
Upvotes: 0
Reputation: 6585
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.
Upvotes: 2