netchx/netch · error · MessageException
Pleases install pcap2socks's dependency
Error message
Pleases install pcap2socks's dependency
What it means
Thrown by PcapController.OnStartFailed when the pcap2socks log file is empty (Length == 0), interpreted as pcap2socks having died before producing any output — the classic signature of a missing Npcap/WinPcap capture dependency. Before throwing, it spawns a task that opens the pcap2socks dependencies URL after a 1-second delay.
Source
Thrown at Netch/Controllers/PcapController.cs:94
}
protected override void OnStarted()
{
Global.MainForm.BeginInvoke(() => _form.Show());
}
protected override void OnStartFailed()
{
if (new FileInfo(LogPath).Length == 0)
{
Task.Run(() =>
{
Thread.Sleep(1000);
Utils.Utils.Open("https://github.com/zhxie/pcap2socks#dependencies");
})
.Forget();
throw new MessageException("Pleases install pcap2socks's dependency");
}
Utils.Utils.Open(LogPath);
}
}View on GitHub (pinned to 9d99eb1c5a)
Solutions
- Install Npcap (the URL the controller opens: github.com/zhxie/pcap2socks#dependencies) with the WinPcap-compatible DLL option.
- Restart Netch after installing Npcap.
- Verify Npcap is present: look for 'NPCAP' in `getcap -D` or the installed programs list.
- If you didn't mean to use pcap2socks, switch the mode away from ShareMode.
Defensive patterns
Strategy: validation
Validate before calling
// Detect the missing capture dependency before offering ShareMode.
bool npcapInstalled = Directory.GetFiles(Environment.SystemDirectory, "wpcap.dll").Any()
|| Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.System), "Packet.dll").Any();
if (!npcapInstalled)
throw new MessageException("pcap2socks requires Npcap to be installed."); Try / catch
try { await pcapController.StartAsync(server, mode); }
catch (MessageException ex) when (ex.Message.Contains("pcap2socks's dependency"))
{
// The controller already opened the dependencies URL; prompt the user to install Npcap and restart.
PromptInstallNpcapAndRestart();
} Prevention
- Install Npcap with the WinPcap API-compatible option before first use of ShareMode.
- Disable ShareMode in the UI when Npcap isn't detected.
- Reinstall Npcap if the ShareMode suddenly starts failing after an OS reset.
- Prefer TUN mode if you don't want a capture driver dependency.
When it happens
Trigger: pcap2socks started, immediately exited because no packet capture driver (Npcap) is installed, and wrote nothing to its log; the ShareMode (PcapController) was selected on a machine without Npcap.
Common situations: Fresh Windows install with Netch but no Npcap; Npcap uninstalled; Npcap installed without the 'WinPcap API-compatible Mode' option; user picked ShareMode by mistake.
Related errors
- {e.Message} Missing File or runtime components
- AioDNS start failed.
- bin\{mainFile} file not found!
- {Name} 控制器启动失败
- {Name} 控制器启动超时
AI-assisted analysis of netchx/netch@9d99eb1c5a (2026-08-13).
Data as JSON: /api/errors/8d1d5ab05bd29087.
Report an issue: GitHub.