DelphiFAQ Home Search:

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

 

comments198 comments. Current rating: 3 stars (197 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 12 of 14, other pages: 1 2 3 9 10 11 [12] 13 14
2020-07-30, 13:32:48
Reynaldo  
rating
how much is prednisone at walmart
2020-07-31, 00:41:24
Leah  
rating
prednisone without dr prescription
2020-07-31, 03:24:29
Genesis from Ukraine  
rating
best place to buy generic cialis online
2020-07-31, 04:06:31
Consuelo  
rating
why is there no generic cialis
2020-08-03, 23:37:26
Ida  
rating
coupons for hydroxychloroquine 200mg
2020-08-04, 00:05:24
Tegan  
rating
prednisone over counter equivalent
2020-08-04, 00:58:23
Brady  
rating
5mg prednisone every day
2020-08-04, 01:33:33
Shelli  
rating
deltasone 20 mg tablet
2020-08-04, 01:54:38
Jasper  
rating
prednisone without dr prescription
2020-08-04, 02:03:39
Monique  
rating
how much prednisone for dogs
2020-08-04, 05:21:03
Riley  
rating
generic of prednisone
2020-08-04, 05:57:37
Hollie from Lebanon  
rating
prednisone without dr prescription
2020-08-04, 06:31:03
Lashay from United States  
rating
walmart prednisone price
2020-08-04, 07:00:09
Winston  
rating
prednisone 20 mg for dogs
2020-08-04, 07:59:28
Vicky from United States  
rating
prednisone 10 mg tabs
You are on page 12 of 14, other pages: 1 2 3 9 10 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: