mono/mono — pull request #600 by tr8dr (2013-03-16 15:50:23+00:00)
Title: Fix for bug 9250 (critical bug for embedded mono)

System.Net.Sockets/Socket_2_1 had a bug introduced in 3.0.3+. The static constructor determines whether the socket / system can support ipv6. In the process uses ConfigurationManager to check application properties related to network settings.

ConfiguratationManager will always produce a ConfigurationErrorsException exception when used in the context of an application embedding mono, as there is no application configuration in this context.

This bug has preventing me from being able to upgrade from 3.0.2 for 3 months, so appreciate if can be integrated soon.

The solution is then to guard against this exception in the configuration tests and fall through to the alternative test for ipv6 functionality. The change is just try / catch + comments, nothing more.

I did not add a unit test for this as there is no way to demonstrate the problem through a C# unit test, short of creating an embedded application that attempts to create a Socket or use one of the network related facilities.

Needless to say the change does not affect the normal behavior of Socket initialization in the context of a mono exe AND also provides correct behavior for embedded applications.