473,608 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Unrecogniz ed configuration section appsettings" exception thrown - Configuration.A ppsettings(key)

I have spent more time than I care to admit trying to track down a very
subtle error.

Here is my app's xx.exe.config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<appsettings>
<add key="PasswordPr ovider" value="fudge" />
</appsettings>
</configuration>
Here is the code which reads the xx.exe.config file generated from the
app.config;
string val= "test" ;
string key = "test";
try
{
string filename =
AppDomain.Curre ntDomain.SetupI nformation.Conf igurationFile;

val=Configurati onSettings.AppS ettings[key];
}
catch(Exception ex)
{
Console.WriteLi ne("{0} Exception caught.", ex);

Here is the exception;
+ ex {@"Unrecogniz ed configuration section appsettings
(C:\Webconfig.e xe.config line 3)" } System.Exceptio n

*************** **********
any ideas? I am certain the config file is well formed. This is a test
project with no other code to complicate this test.
Is there any possibility that anything in the WinXP environment I inherited
could alter any of Visual Studio's runtime?
Any setting in VS.NET options? Machine.config setttings? I can't remember
how to tell WinXP Pro how to add the security tab to the folder options for
me to check the folder security settings....but from the error message, that
doesn't appear to be the problem.

Thank you!
-greg
Nov 16 '05 #1
2 15478
hazz wrote:
I have spent more time than I care to admit trying to track down a very
subtle error.

Here is my app's xx.exe.config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<appsettings>
<add key="PasswordPr ovider" value="fudge" />
</appsettings>
</configuration>
Here is the code which reads the xx.exe.config file generated from the
app.config;
string val= "test" ;
string key = "test";
try
{
string filename =
AppDomain.Curre ntDomain.SetupI nformation.Conf igurationFile;

val=Configurati onSettings.AppS ettings[key];
}
catch(Exception ex)
{
Console.WriteLi ne("{0} Exception caught.", ex);

Here is the exception;
+ ex {@"Unrecogniz ed configuration section appsettings
(C:\Webconfig.e xe.config line 3)" } System.Exceptio n

*************** **********
any ideas? I am certain the config file is well formed. This is a test
project with no other code to complicate this test.
Is there any possibility that anything in the WinXP environment I inherited
could alter any of Visual Studio's runtime?
Any setting in VS.NET options? Machine.config setttings? I can't remember
how to tell WinXP Pro how to add the security tab to the folder options for
me to check the folder security settings....but from the error message, that
doesn't appear to be the problem.

XML is case-sensitive.

It should be <appSettings>

http://msdn.microsoft.com/library/?u...ngselement.asp

Cheers

Arne Janning
Nov 16 '05 #2
I guess I shouldn't have said "subtle" error. That is right there, front and
center.
Oh...my....GOSH ....

Thank you Arne!! That's it.
-greg

"Arne Janning" <sp************ *****@msn.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
hazz wrote:
I have spent more time than I care to admit trying to track down a very
subtle error.

Here is my app's xx.exe.config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<appsettings>
<add key="PasswordPr ovider" value="fudge" />
</appsettings>
</configuration>
Here is the code which reads the xx.exe.config file generated from the
app.config;
string val= "test" ;
string key = "test";
try
{
string filename =
AppDomain.Curre ntDomain.SetupI nformation.Conf igurationFile;

val=Configurati onSettings.AppS ettings[key];
}
catch(Exception ex)
{
Console.WriteLi ne("{0} Exception caught.", ex);

Here is the exception;
+ ex {@"Unrecogniz ed configuration section appsettings
(C:\Webconfig.e xe.config line 3)" } System.Exceptio n

*************** **********
any ideas? I am certain the config file is well formed. This is a test
project with no other code to complicate this test.
Is there any possibility that anything in the WinXP environment I inherited could alter any of Visual Studio's runtime?
Any setting in VS.NET options? Machine.config setttings? I can't remember how to tell WinXP Pro how to add the security tab to the folder options for me to check the folder security settings....but from the error message, that doesn't appear to be the problem.

XML is case-sensitive.

It should be <appSettings>

http://msdn.microsoft.com/library/?u...ngselement.asp
Cheers

Arne Janning

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2011
by: Al Repasky | last post by:
The program I have written with VB/NET 2003 has a Myapp.exe.config file that I did not know I would be creating. My program using an Access db and can not find the DB file after building the executable. When this config file is there it runs ok and when it is not there it can not find the DB file. When I put the program on another computer it can not find the DB file either way. Does anyone have an idea what is happening? Thanks, Al
1
2114
by: Bakunin | last post by:
Hi, I may be doing something dumb but.......I have been using the data access ent lib to do the HOL's. All is well. However I now want to add the data access functionality to my BTS2004 project, therefore requiring strong name key. When I try to compile the Data solution from source I get Namespace "Configuration" does not exist in Microsoft.practices.EnterpriseLibrary.Data are you missing..... The problem is that I am not. I can't...
6
6098
by: Tony | last post by:
Dear All, When I run an example program on the http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3 I received an error message: "The ConnectionString property has not been initialized.
2
1785
by: lauralucas | last post by:
Hello I'm trying to use a connection string stored in web.config here is the web.config part <appSettings> <add key="NDDbase" value="Server=SOMESERVER\\SOMEINSTANCE;integrated security=SSPI;database=NDD"/>
0
1651
by: roxanaislam | last post by:
Hi: I have a search form in my application which has 4 dropdown list controls, one text box, one "GO" button, one "reset" button. When the "GO" button is clicked the form gets submitted and the results page is displayed. When I press the "enter" key nothing happens. I want to submit the form by pressing the "enter" key also. I have placed <input type="text" style="display:none"> after the <form> tag in the HTML section. Now if my cursor...
4
3872
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown list controls, one text box, one "GO" button, one "reset" button. When the "GO" button is clicked the form gets submitted and the results page is displayed. When I press the "enter" key nothing happens. I want to submit the form by pressing the "enter"...
8
2633
by: Mark | last post by:
Could someone provide me with details or a link on how the line of code executes underneath the hood? Assume it's executed in an ASP.NET application. string blah = ConfigurationSettings.AppSettings Once your application has called for the "foo" key once, how expensive is to call the same line again? My gut tells me that the CLR likely stores these values in memory in a string dictionary or similar. Looking up the value requires the...
1
13143
by: sandy.82in | last post by:
Hi I'm new to C# , I'm using VS2005 and .NET2.0 .Here is my issue i just developed a simple application with app.config , and a simple class library and following is my app.configfile <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Setting1" value="Very" />
1
5810
by: Ken | last post by:
I'm currently using 1.1. Is there any way using the value of a ConfigurationSettings.AppSettings as a key of ConfigurationSettings.AppSettings.Tosting( )]? for example in web.config <add key="company" value="Hyundai" /> <add key="Hyundai" value="sonata" />
0
8059
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6815
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4023
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1328
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.