The section mapping system wasn't being initialized and used properly since some ifdefs had
been left in the source code. This caused a null reference exception while trying to perform
some HTTP requests and, as the result, broke Xamarin Studio activation.
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Reflection;
-#if MONOWEB_DEP
using Mono.Web.Util;
-#endif
using System.Xml;
using System.Configuration;
using System.Configuration.Internal;
value = collection;
}
#else
-#if MONOWEB_DEP
object value = SettingsMappingManager.MapSection (get_runtime_object.Invoke (section, new object [0]));
-#else
- object value = null;
-#endif
#endif
if (cachePath != null)
cacheKey = baseCacheKey ^ cachePath.GetHashCode ();
configurations.Remove (GetCurrentPath (ctx));
}
-#if TARGET_J2EE || MONOWEB_DEP
readonly static MethodInfo get_runtime_object = typeof (ConfigurationSection).GetMethod ("GetRuntimeObject", BindingFlags.NonPublic | BindingFlags.Instance);
-#endif
public static object GetWebApplicationSection (string sectionName)
{
using System.Web.Management;
using System.Web.UI;
using System.Web.Util;
-#if MONOWEB_DEP
using Mono.Web.Util;
-#endif
using System.Threading;
#if TARGET_J2EE
using Mainsoft.Web;
try {
WebConfigurationManager.Init ();
-#if MONOWEB_DEP
SettingsMappingManager.Init ();
-#endif
runtime_section = (HttpRuntimeSection) WebConfigurationManager.GetSection ("system.web/httpRuntime");
} catch (Exception ex) {
initialException = ex;