469,366 Members | 2,286 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

C# Winforms 2.0 Properties.Settings.Default.MySetting always default

2
I am trying to read an application setting from my App.Config file that I have modified from the default value that was entered into the settings window under project properties.

string myConn = Properties.Settings.Default.MyConnection

This always returns the default value and never the value that I entered into App.Config. The value in the project folder in App.Config as well as in debug folder in MyApp.Exe.Config show the modified value but the code always returns the default value.

Can anyone help with this? I've seen a few other posts about this but their problems were often associated with a separate DLL trying to read config values. This is the main app.

Thank you
May 22 '07 #1
2 9013
jtw
2
Never Mind - I had a previous Connection string setting using the old format and didn't realize that Properties.Settings.Default is looking for one named Namespace.Properties.Settings.MyConnString instead of just MyConnString. Sorry for the false alarm.

JTW


I am trying to read an application setting from my App.Config file that I have modified from the default value that was entered into the settings window under project properties.

string myConn = Properties.Settings.Default.MyConnection

This always returns the default value and never the value that I entered into App.Config. The value in the project folder in App.Config as well as in debug folder in MyApp.Exe.Config show the modified value but the code always returns the default value.

Can anyone help with this? I've seen a few other posts about this but their problems were often associated with a separate DLL trying to read config values. This is the main app.

Thank you
May 22 '07 #2
kovax3
1
bon jour
dans le fichier "Settings.Designer.cs"
public string MyConnectionString {
get {
return ((string)(this["MyConnectionString"]));
}
//ajouter le seteur 'add this set"
set
{
this["MyConnectionString"] = value;
}
}
bonne chance
Apr 3 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Lecture Snoddddgrass | last post: by
7 posts views Thread by Kirk | last post: by
4 posts views Thread by Ron Gliane | last post: by
reply views Thread by John Peterson | last post: by
5 posts views Thread by Andy | last post: by
reply views Thread by =?Utf-8?B?UmljayBHbG9z?= | last post: by
13 posts views Thread by Dave | last post: by
1 post views Thread by David Jackson | last post: by
23 posts views Thread by raylopez99 | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.