473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 6373
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.