Merge pull request #4453 from lambdageek/bug-49721
[mono.git] / mcs / class / System.Configuration / System.Configuration / AppSettingsSection.cs
index b6e3468fbda0fc284a27ee19128628a6339311e3..65b63cdee8b266d8699e9eb47c6e565b1f84ac7e 100644 (file)
@@ -71,8 +71,12 @@ namespace System.Configuration {
 
                        if (File != "") {
                                try {
-                                       Stream s = System.IO.File.OpenRead (File);
-                                       XmlReader subreader = new ConfigXmlTextReader (s, File);
+                                       string filePath = File;
+                                       if (!Path.IsPathRooted (filePath))
+                                               filePath = Path.Combine (Path.GetDirectoryName (Configuration.FilePath), filePath);
+
+                                       Stream s = System.IO.File.OpenRead (filePath);
+                                       XmlReader subreader = new ConfigXmlTextReader (s, filePath);
                                        base.DeserializeElement (subreader, serializeCollectionKey);
                                        s.Close ();
                                }
@@ -91,10 +95,10 @@ namespace System.Configuration {
 
                [MonoTODO]
                protected internal override string SerializeSection (
-                       ConfigurationElement parent, string name, ConfigurationSaveMode mode)
+                       ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
                {
                        if (File == "") {
-                               return base.SerializeSection (parent, name, mode);
+                               return base.SerializeSection (parentElement, name, saveMode);
                        }
                        else {
                                throw new NotImplementedException ();