Create a Mono console application in MonoDevelop, designed for Mono / .NET 4.0 on OS X, to act as a TCP socket server.
The following line of code does not work (which you usually use on the Windows side):
var interfaces = NetworkInterface.GetAllNetworkInterfaces();
... with System.DllNotFoundException: iphlpapi.dll error System.DllNotFoundException: iphlpapi.dll
I can say that this is only supported on Windows and Linux. However, there seems to be another method developed for the Mac:
System.Net.NetworkInformation.MacOsNetworkInterface.GetAllNetworkInterfaces();
Although this is apparently recognized by MonoDevelop, it cannot compile with the error The type or namespace 'MacOsNetworkInterface' does not exist in the namespace 'System.Net.NetworkInformation'. . There are already links to System and System.Net.
What am I missing?
Edit: It was discovered that NetworkInterface.GetAllNetworkInterfaces() works when I create a new C # console application in MonoDevelop, but it doesnβt work within an existing project ( NetworkComms.net ) - both of them are the same, Mono, .NET 4.0 with the same System references and System.Net v4.0.0.0, what's the difference?
source share