添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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.

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.

"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, 2018 at 20:10

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.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.