[system.web] remove some more remnants of Mono.Web.dll to fix Xamarin Studio activation
authorMarek Habersack <grendel@twistedcode.net>
Mon, 12 May 2014 17:31:15 +0000 (19:31 +0200)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 12 May 2014 17:33:10 +0000 (19:33 +0200)
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.

mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs
mcs/class/System.Web/System.Web/HttpRuntime.cs

index 63cca69d6e643b3d3ca11c9190d6861ed01976be..14bcf13a6e0c6720fbfd4e92d8709920b38e8a54 100644 (file)
@@ -36,9 +36,7 @@ using System.Collections;
 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;
@@ -531,11 +529,7 @@ namespace System.Web.Configuration {
                                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 ();
@@ -683,9 +677,7 @@ namespace System.Web.Configuration {
                        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)
                {
index 2e68a21a852dfd90b51c9520f2d8890f0362cb51..2f234ef4ed3504db57184081085b2e91a61d8e08 100644 (file)
@@ -44,9 +44,7 @@ using System.Web.Configuration;
 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;
@@ -136,9 +134,7 @@ namespace System.Web
 
                        try {
                                WebConfigurationManager.Init ();
-#if MONOWEB_DEP
                                SettingsMappingManager.Init ();
-#endif
                                runtime_section = (HttpRuntimeSection) WebConfigurationManager.GetSection ("system.web/httpRuntime");
                        } catch (Exception ex) {
                                initialException = ex;