473,394 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

"Unrecognized configuration section appsettings" exception thrown - Configuration.Appsettings(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" ?>
<configuration>
<appsettings>
<add key="PasswordProvider" 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.CurrentDomain.SetupInformation.Configura tionFile;

val=ConfigurationSettings.AppSettings[key];
}
catch(Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);

Here is the exception;
+ ex {@"Unrecognized configuration section appsettings
(C:\Webconfig.exe.config line 3)" } System.Exception

*************************
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 15418
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" ?>
<configuration>
<appsettings>
<add key="PasswordProvider" 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.CurrentDomain.SetupInformation.Configura tionFile;

val=ConfigurationSettings.AppSettings[key];
}
catch(Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);

Here is the exception;
+ ex {@"Unrecognized configuration section appsettings
(C:\Webconfig.exe.config line 3)" } System.Exception

*************************
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****************@TK2MSFTNGP10.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" ?>
<configuration>
<appsettings>
<add key="PasswordProvider" 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.CurrentDomain.SetupInformation.Configura tionFile;

val=ConfigurationSettings.AppSettings[key];
}
catch(Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);

Here is the exception;
+ ex {@"Unrecognized configuration section appsettings
(C:\Webconfig.exe.config line 3)" } System.Exception

*************************
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
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...
1
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,...
6
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 ...
2
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...
0
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...
4
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...
8
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 =...
1
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...
1
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.