472,805 Members | 943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 6328
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: babylon | last post by:
i have a .Net dll and there are codes to access the AppSettings inside the dll However, I would like to use the dll from a C++ program by wrapping the .Net dll as a COM So..how could I...
3
by: Charlie | last post by:
Hi: I created a config file to retrieve DSN at runtime from a C# library project (DLL). I name the file same as DLL (libRADIUS.config). Here is the contents of the file... <?xml...
2
by: herbert | last post by:
Microsoft please publish an article about "best practice" handling the application configuration/settings in .NET 2.0 for VB.NET. I am lost in ConfigurationManager, Add New Item Settings Dialog,...
1
by: herbert | last post by:
In VS.2005 there are three templates for storing application info: Resource File Settings File Application File. 1) What is the purpose of each one? When to use, when not? 2) How does VB's...
9
by: Dick | last post by:
Visual Studio saves lots of values in the project's app.config file (connection strings for datasets, My.settings, etc.), but as far as I can see, if the project is in the middle teir, these values...
1
by: Michael White | last post by:
In my app.config file there are various user settings for printers, etc that the user may customize. When I publish an update using Click-once and the app installs the latest version to the user's...
3
by: DaBrain | last post by:
I have a program that uses settings. When I save my settings they are saved: Properties.Settings.Default.Save(); when I restart the application, my settings are present, the changes are in...
1
by: huntco | last post by:
VS2005, .Net 2.x I've built a .dll from the classlibrary template. Everything works great on the development box. When moving it over to the production box, I started getting database connection...
3
by: Scott M. | last post by:
If I add a setting to my project in the settings designer and mark it as a user setting, and then access and modify the setting via code, where is the updated setting stored so that it won't be...
1
by: Tony | last post by:
Hello! I use VS2005 and within folder properties there is a file called Settings.setting. I can remove this file and rebuild the application without any kind of error or problems. So my...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.