469,948 Members | 2,819 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

cannot get any app settings after renaming app.config

Hi there, it is driving me crazy. Aftering renaming app.config the following
code I always get null on myApp. It works if I keep the name app.config. Why?

string myApp = ConfigurationSettings.AppSettings["AppName"];

Thanks!
Nov 17 '05 #1
2 6062
Hi,

The IDE recognizes 'app.config' as a special name for the application
configuration file. When you build your project, this file is renamed to
'<yourappname>.exe.config' and copied to the output folder. If you rename
the source file to anything other than 'app.config', the IDE will no more
treat it in any automatic fashion.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"cloudx" <cl****@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
Hi there, it is driving me crazy. Aftering renaming app.config the
following
code I always get null on myApp. It works if I keep the name app.config.
Why?

string myApp = ConfigurationSettings.AppSettings["AppName"];

Thanks!


Nov 17 '05 #2
Hi Dmytro,

Thanks for your reply. I am just wondering why it allows me to rename but it
doesn't work if so? I did see some posts here saying they made it work after
renaming, I tried as what they suggested but still not working. Did I missing
anything?

Thanks

Cloud

"Dmytro Lapshyn [MVP]" wrote:
Hi,

The IDE recognizes 'app.config' as a special name for the application
configuration file. When you build your project, this file is renamed to
'<yourappname>.exe.config' and copied to the output folder. If you rename
the source file to anything other than 'app.config', the IDE will no more
treat it in any automatic fashion.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"cloudx" <cl****@discussions.microsoft.com> wrote in message
news:B9**********************************@microsof t.com...
Hi there, it is driving me crazy. Aftering renaming app.config the
following
code I always get null on myApp. It works if I keep the name app.config.
Why?

string myApp = ConfigurationSettings.AppSettings["AppName"];

Thanks!


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by babylon | last post: by
3 posts views Thread by Charlie | last post: by
9 posts views Thread by Dick | last post: by
1 post views Thread by Michael White | last post: by
1 post views Thread by huntco | last post: by
3 posts views Thread by Scott M. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.