相关文章推荐
任性的刺猬  ·  西安工业大学教务处·  1 年前    · 
鼻子大的汤圆  ·  Unity3d ...·  1 年前    · 
微笑的海龟  ·  汉中旅游_小红书·  1 年前    · 
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

I want to use Pcap.Net in my C# project. I download and add .dll references to the project.

The project builds successfully but when I run it, the below exception occur.

System.IO.FileNotFoundException was unhandled
  Message=Could not load file or assembly 'PcapDotNet.Core.dll' or one of its dependencies. The specified module could not be found.
  Source=trafcon
  FileName=PcapDotNet.Core.dll
  FusionLog=""
  StackTrace:
       at ObtainingTheDeviceList.Program.Main(String[] args)
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

What do I do?

You probably didn't install one or more of the PCap.Net requirements on the machine where you're trying to run this code.

These requirements (as stated in this page of the PCap.Net project) are:

  • WinPCap;
  • .NET Framework 4.0 or higher;
  • Microsoft Visual C++ 2010 Redistributable Package.
  • 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.