Skip to content

Using Pcap.Net in your programs

Boaz Brickner edited this page Jul 7, 2018 · 6 revisions

Using Pcap.Net in your programs

Creating an application that uses Pcap.Net

To create an application that uses Pcap.Net with Microsoft Visual Studio, follow these steps:

  • Make sure you have .NET Framework 4.5 (or a newer version) installed.
    • Download Microsoft .NET Framework 4.5
    • If you want to use .NET Framework 4, you can only use Pcap.Net 1.0.3.
    • If you want to use .NET Framework 3.5 SP1, you can only use Pcap.Net 0.6.0.
  • Add a reference to PcapDotNet.Base.dll, PcapDotNet.Packets.dll, PcapDotNet.Core.dll and PcapDotNet.Core.Extensions.dll at every project file that uses Pcap.Net.
  • Make sure to not prefer 32 bit or 64 bit in your project settings unless necessary.

Look at Pcap.Net Tutorial for sample programs.

Running Pcap.Net applications

To run an application that uses Pcap.Net, follow these steps:

  • Make sure the application you're using was built in Release mode and not Debug.
  • Install WinPcap 4.1.3 (available at http://www.winpcap.org).
  • Install .NET Framework 4.5 (available at Microsoft Download Center).
  • Install Microsoft Visual C++ 2010 Redistributable Package (available at Microsoft Download Center: x86 version, x64 version). If you have troubles on Windows x64 versions, try installing the x86 version of the Microsoft Visual C++ 2010 Redistributable Package.
  • Install Microsoft Visual C++ 2013 Redistributable Package (available at Microsoft Download Center).