[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
Sat, 11 Oct 2003 14:08:04 -0400 (EDT)


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	2003-10-11 14:08:04.000000000 -0400
+++ shadow/49558.tmp.20568	2003-10-11 14:08:04.000000000 -0400
@@ -0,0 +1,72 @@
+Bug#: 49558
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Mandrake 9.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: chris@turchin.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+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...