DnsClient doesn't work on Azure Web Site

Jun 24, 2012 at 1:53 AM
Edited Jun 24, 2012 at 5:37 AM

I just pushed my ASP.NET MVC app that is using ARSoft.Tools.Net to a new Azure Web Site and found the following. It appears there's no access to the network interfaces on Azure. Is there a workaround?

  System.TypeInitializationException: The type initializer for 'ARSoft.Tools.Net.Dns.DnsClient' threw an exception. ---> System.Net.NetworkInformation.NetworkInformationException: Access is denied
   at System.Net.NetworkInformation.SystemNetworkInterface.PostWin2KGetNetworkInterfaces(AddressFamily family)
   at System.Net.NetworkInformation.SystemNetworkInterface.GetNetworkInterfaces(AddressFamily family)
   at System.Net.NetworkInformation.SystemNetworkInterface.GetNetworkInterfaces()
   at System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
   at ARSoft.Tools.Net.Dns.DnsClient.GetDnsServers()
   at ARSoft.Tools.Net.Dns.DnsClient..cctor()
   --- End of inner exception stack trace ---
   at ARSoft.Tools.Net.Dns.DnsClient.get_Default()
   at Email2CalendarLib.Email2Provider.Resolve()
   at MileLogr.ApiControllers.Signup.Email2ProviderApiController.Get(String calendarEmail)
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass17.<GetExecutor>b__10(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4()
   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
Coordinator
Jun 27, 2012 at 6:42 PM

Issue is fixed in 1.6.1

Aug 26, 2013 at 8:09 PM
Edited Aug 26, 2013 at 8:23 PM
Seems like does not work in Windows Azure WebSites currently, the "DnsClient.Default.Resolve" method returns "null" and no exception is raised.
Jan 14, 2014 at 1:19 PM
Seconded, I'm getting nothing but nulls running in an Azure web site. Is this being documented as a known incompatibility issue or is it on the road map for a fix?