I'm trying to get the local IP address of my Android device using Mono for Android, but failing.

The code I use for the full and compact framework is this:

var iplist = (from a in Dns.GetHostAddresses(Dns.GetHostName())
              where a.AddressFamily == AddressFamily.InterNetwork
              select a).ToArray();
LocalAddress = iplist[0];

Under M4A, however, it falls down early - the Dns.GetHostName() call fails with

System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used

Is there a known issue with Dns.GetHostName under M4A? Is there an alternate way to get the local address using M4A?

Edit
Report