[Mono-bugs] [Bug 49558][Nor] New - ConfigurationSettings.AppSettings["keyname"] where <appSettings> element is missing from the .config file (or the tagname was mistyped) hangs the application.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 11 Feb 2004 16:17:28 -0500 (EST)


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 chris@turchin.net.

http://bugzilla.ximian.com/show_bug.cgi?id=49558

--- shadow/49558	2004-02-11 16:17:28.000000000 -0500
+++ shadow/49558.tmp.26582	2004-02-11 16:17:28.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 49558
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Mandrake 9.1
+OS Details: 
+Status: RESOLVED   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: chris@turchin.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: ConfigurationSettings.AppSettings["keyname"] where <appSettings> element is missing from the .config file (or the tagname was mistyped)  hangs the application.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+a call to ConfigurationSettings.AppSettings["keyname"] where <appSettings>
+element is missing from the .config file (or the tagname was mistyped) 
+hangs the application. no return value (null) would be better.
+
+
+Steps to reproduce the problem:
+1. create app.config (hello.exe.config) like this:
+
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+	<!--
+	<appSettings>
+	<add key="keyname" value="Administrator"/>
+	</appSettings>
+	-->
+</configuration>
+
+
+
+2. create hello.cs
+
+class moo
+{
+public static void Main(string[] args)
+{
+	string mystring =
+System.Configuration.ConfigurationSettings.AppSettings["keyname"];
+	System.Console.WriteLine(mystring);
+}
+}
+
+
+3. mcs hello.cs;mono hello.exe
+
+Actual Results:
+
+application hangs, cpu climbs, no return nor exception
+
+Expected Results:
+
+in MS.NET 1.1. the call to AppSettings returns null.
+
+How often does this happen? 
+
+every time
+
+Additional Information:
+
+it might be in the xml classes, and i am using the non-managed ones right
+now...
+
+------- Additional Comments From chris@turchin.net  2004-02-11 16:17 -------
+tested on 2004-02-11 using current cvs and this is no longer an issue.