using System.Collections;
using System.Collections.Specialized;
using System.IO;
-using System.Reflection;
using System.Runtime.CompilerServices;
using System.Xml;
using System.Xml.XPath;
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;
}
}
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);
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;