DelphiFAQ Home Search:

Error message 'the key ... does not exist in the appSettings configuration section'

 

comments196 comments. Current rating: 3 stars (195 votes). Leave comments and/ or rate it.

Question:

I try to compile Visual C++ application that a friend mailed me. The code compiles fine, I can start the application, but when I open a form (dialog), the following exception is thrown:

"the key novelDesign.checked does not exist in the appSettings configuration section"

novelDesign is a radio button in that form. What's going on?

Answer:

Apparantly your friend decided to have default values for the dialog's controls stored in an external .config file. His computer has the config file (typically named application.exe.config or application.config). You could run the application in the debugger and see where it breaks.

It is probably in the InitializeComponent() method, looking as shown in the code below.
Remove the line with the GetValue() reference and it will run fine.

My personal opinion is that default values for dialog controls do not belong in an external .config file anyway.



void InitializeComponent(void) {
	System::Configuration::AppSettingsReader *  configurationAppSettings =
		 new System::Configuration::AppSettingsReader();

	// ..
	// comment out the next line
	this->novelDesign1->Checked = (*__try_cast<__box System::Boolean * >
		(configurationAppSettings->GetValue(S"novelDesign.Checked",
		__typeof(System::Boolean))));

	// the remaing code is ok
	this->novelDesign1->Location = System::Drawing::Point(16, 48);
	// ..
}

Comments:

You are on page 6 of 14, other pages: 1 2 3 4 5 [6] 7 8 9 11 12 13 14
2020-07-02, 12:12:21
Demetria  
rating
clomid for women at walmart
2020-07-03, 10:31:01
Liliana from United States  
rating
clomid for women price
2020-07-03, 13:41:10
Rosalyn  
rating
amoxicillin by mail
2020-07-03, 16:05:13
Mamie  
rating
viagra for sale canada
2020-07-03, 16:47:52
Dominic from Switzerland  
rating
best place to buy cialis online
2020-07-03, 19:03:55
Anh  
rating
viagra 100mg pills generic
2020-07-04, 06:34:02
Donte  
rating
fish antibiotics amoxicillin walmart
2020-07-05, 08:13:18
Abby  
rating
is there a generic cialis
2020-07-05, 14:39:55
Maxie  
rating
men's ed pills
2020-07-05, 19:49:50
Les from Uzbekistan  
rating
hydroxychloroquine 200 mg cost
2020-07-05, 19:54:23
Linda  
rating
cost of chloroquine
2020-07-05, 19:55:09
Arielle  
rating
can i buy hydroxychloroquine from canada
2020-07-05, 19:55:17
Ina  
rating
chloroquine vs hydroxychloroquine
2020-07-05, 19:56:21
Bernardo from United States  
rating
buy hydroxychloroquine from india
2020-07-05, 19:58:59
Nona from United States  
rating
hydroxychloroquine sulfate 200mg tablet
You are on page 6 of 14, other pages: 1 2 3 4 5 [6] 7 8 9 11 12 13 14

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: