[Mono-bugs] [Bug 34191][Nor] New - Problem running an application that uses a .config file
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
18 Nov 2002 11:55:31 -0000
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by carlosga@telefonica.net.
http://bugzilla.ximian.com/show_bug.cgi?id=34191
--- shadow/34191 Mon Nov 18 06:55:31 2002
+++ shadow/34191.tmp.19587 Mon Nov 18 06:55:31 2002
@@ -0,0 +1,90 @@
+Bug#: 34191
+Product: Mono/Runtime
+Version: unspecified
+OS: other
+OS Details: Red Hat 8.0
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: carlosga@telefonica.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Problem running an application that uses a .config file
+
+Hello:
+
+
+When i try to use an application that uses a XML .config file a got the
+next exception:
+
+Unhandled Exception: System.Xml.XmlException: cannot insert this node to
+this position.
+in <0x0032e> 00 System.Xml.XmlNode:InsertBefore
+(System.Xml.XmlNode,System.Xml.XmlNode)
+in <0x00019> 00 System.Xml.XmlNode:AppendChild (System.Xml.XmlNode)
+in <0x0060f> 00 System.Xml.XmlNode:ConstructDOM
+(System.Xml.XmlReader,System.Xml.XmlNode)
+in <0x0002e> 00 System.Xml.XmlDocument:Load (System.Xml.XmlReader)
+in <0x000d7> 00 System.Configuration.ConfigXmlDocument:LoadSingleElement
+(string,System.Xml.XmlTextReader)
+in <0x001e3> 00
+System.Configuration.ConfigurationData:GetDocumentForSection (string)
+in <0x000c0> 00 System.Configuration.ConfigurationData:GetConfig (string)
+in <0x0002c> 00 System.Configuration.DefaultConfig:GetConfig (string)
+in <0x0003d> 00 System.Configuration.ConfigurationSettings:GetConfig (string)
+in <0x00014> 00 System.Configuration.ConfigurationSettings:get_AppSettings ()
+in <0x00012> 00 .TestApp:Main ()
+
+
+Test case:
+
+
+.config file:
+
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+<appSettings>
+ <add key="User" value="SYSDBA" />
+ <add key="Password" value="masterkey" />
+ <add key="Database" value="/opt/interbase/examples/employee.gdb" />
+ <add key="Server" value="localhost.localdomain" />
+ <add key="Port" value="3050" />
+ <add key="Dialect" value="3" />
+ <add key="Charset" value="NONE" />
+ <add key="Role" value="" />
+ <add key="Connection lifetime" value="15" />
+ <add key="Pooling" value="true" />
+</appSettings>
+</configuration>
+
+
+.cs file:
+
+using System;
+using System.Text;
+using System.Data;
+using System.Configuration;
+
+class TestApp
+{
+ static void Main()
+ {
+ string connectionString =
+ "Database=" + ConfigurationSettings.AppSettings["Database"] + ";" +
+ "User=" + ConfigurationSettings.AppSettings["User"] + ";" +
+ "Password=" + ConfigurationSettings.AppSettings["Password"] + ";" +
+ "Server=" + ConfigurationSettings.AppSettings["Server"] + ";" +
+ "Port=" + ConfigurationSettings.AppSettings["Port"] + ";" +
+ "Dialect=" + ConfigurationSettings.AppSettings["Dialect"] + ";" +
+ "Charset=" + ConfigurationSettings.AppSettings["Charset"] + ";" +
+ "Role=" + ConfigurationSettings.AppSettings["Role"] + ";" +
+ "Connection Lifetime=" + ConfigurationSettings.AppSettings["Connection
+lifetime"] + ";" +
+ "Pooling=" + ConfigurationSettings.AppSettings["Pooling"];
+ }
+}