2002-12-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System / System.Configuration / ConfigurationSettings.cs
index e02600b12c6dcff988f40fcdb052c80b87021c6f..8d5f558f877cf995855ea1736a801879a68b6963 100644 (file)
@@ -13,7 +13,6 @@ using System;
 using System.Collections;
 using System.Collections.Specialized;
 using System.IO;
-using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Xml;
 using System.Xml.XPath;
@@ -119,24 +118,13 @@ namespace System.Configuration
 
                private static string GetAppConfigPath ()
                {
-               /* FIXME: Uncomment and use this stuff when the current domain is initialized with
-                         the appropiate information.
                        AppDomainSetup currentInfo = AppDomain.CurrentDomain.SetupInformation;
 
-                       string appBase = currentInfo.ApplicationBase;
                        string configFile = currentInfo.ConfigurationFile;
-                       // FIXME: need to check out default domain configuration file name
                        if (configFile == null || configFile.Length == 0)
                                return null;
-               */
 
-               // Remove when uncomment the previous comment
-                       string assemblyName = Assembly.GetEntryAssembly ().FullName;
-                       string appBase = Path.GetDirectoryName (assemblyName);
-                       string configFile = Path.GetFileName (assemblyName) + ".exe.config";
-               // End remove
-
-                       return Path.Combine (appBase, configFile);
+                       return configFile;
 
                }
        }
@@ -197,17 +185,7 @@ namespace System.Configuration
                        if (o is IConfigurationSectionHandler)
                                return (IConfigurationSectionHandler) o;
 
-                       string [] typeInfo = ((string) o).Split (',');
-                       Type t;
-                       
-                       // Hack. Type.GetType should be enough
-                       if (typeInfo.Length > 1) {
-                               Assembly ass = Assembly.Load (typeInfo [1].Trim ());
-                               t = ass.GetType (typeInfo [0].Trim ());
-                       } else {
-                               t = Type.GetType (typeInfo [0]);
-                       }
-                       
+                       Type t = Type.GetType ((string) o);
                        if (t == null)
                                throw new ConfigurationException ("Cannot get Type for " + o);
 
@@ -385,7 +363,7 @@ namespace System.Configuration
                                removeValue = sectionName + '/' + removeValue;
 
                        object o = LookForFactory (removeValue);
-                       if (o != null && o != removedMark)
+                       if (o != null && o == removedMark)
                                ThrowException ("No factory for " + removeValue, reader);
 
                        factories [removeValue] = removedMark;