I have a problem: change setting in user control’s configuration file has no effect.
I can add “setting” to a user control project and can make following code work:
label1.Text = Properties.Settings.Default.DisplayName;
The output of this usercontrol project is “usercontorl1.dll” and “usercontrol1.dll.config”.
When I test it in other project, I found that change the value in config file has no effect to its display. And even if there is no config file, it works fine!
How can I solve this problem , I really need a configurable user control.
Thank you.
Windows 7 64 bits
VS 2008
.Net 3.5
Ref:
http://social.msdn.microsoft.com/Forums/da-DK/msbuild/thread/cbbd893c-8d5d-4699-bf51-bdd110946c94
https://stackoverflow.com/questions/6505252/winform-store-configuration-data-for-user-control
You need to copy the config section to the App.Config of the using project.
The (only) file used at runtime is
AppName.exe.config