472,096 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

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 9107
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.