Usercontrol, app.config design time error

Lau

Newcomer
Joined
Jul 14, 2003
Messages
1
Location
Brisbane, Australia
I have a usercontrol that refers to a app.config configuration setting in it's constructor.
When I try to drag the usercontrol onto a form, I get the error:

... The key '....' does not exist in the appSettings configuration section.

The key is specified in the app.config file, and the code will run properly if I 'inline' the usercontrol on a form, it's just this design time error that prevents me from making use of configurable user controls.

Has anyone managed to get a usercontrol to read settings from app.config in such a way?
 
From the help file:
The configuration file in the project folder is named App.config. When you build the project, it is copied to the output folder and renamed to Assemblyname.config, where assemblyname is the project output, for example, MyLibrary.dll or MyApplication.exe. You need to modify this copy of the .config file to affect a deployed application.

Sounds like this might be the problem. Added the setting to the app.config but not the usercontrolname.config file.
 
does not work...

I have the same problem...
Did you get the user control to read the settings from the app.config file?
 
Back
Top