Closed TechnoChimp closed 11 months ago
what libpcap version did you install?
I installed the latest libpcap-dev from apt. This version seems to be fine. If I link the libpcap.so file as libwpcap.so then it does work, but based on old closed issues that shouldn't be needed since that issue was resolved.
the solution implemented for dynamic detection of pcap library, is not compatible with PublishAot
Ah ok, that did seem to be my problem. Removing Aot I can now run the executable on a machine as long as libpcap-dev is installed on that machine. (If libpcap-dev is not installed I still get the error regarding libwpcap missing which threw me off for a second there.)
Regarding the libpcap-dev dependency, I don't suppose there's a way to bundle this into the build package so it doesn't need to be installed alongside my generated executable?
sharppcap lools for a libpcap.so, whether you can bundle that or not (and it keeps working across systems), is a question for the libpcap maintainers, there is no definitive answer here.
Tested on both Ubuntu 18.04 and Ubuntu 22.04. Both with dotnet7.
.csproj
Build command:
dotnet publish -r linux-amd64 -c Release
Full output when running the generated executable: