Ercument Eskar Ercument Eskar - 1 year ago 140
C# Question

NetFilter dll can not load

I download netfilter sdk demo and fallow the install instructions. NetFilter2.sys copied to system32\driver folder and register with nfregdrv.exe netfilter2 command. I did these steps with install.bat with run as admin rights.

When i compile and run Delphi sample everythings fine. But CSharp example doesn't build.

"System.DllNotFoundException: Unable to load DLL 'nfapi': The
specified module could not be found. (Exception from HRESULT:

in NFAPI.nf_init("netfilter2", m_eh) > nf_adjustProcessPriviledges();

nfapinet.dll added in project references. I didn't change filename netfilter2.sys. Delphi project can find in nf_init(PAnsiChar('netfilter2'), eh); line and working properly.

What i miss?

Answer Source

i ask to and Vitaly answer me. It's about debug mode. i select release and run succesfully. If you want to debug, you have to copy manually all required C++ dlls from the appropriate release_c_api folder.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download