473,401 Members | 2,068 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,401 software developers and data experts.

using a config file

I'm a C# noob trying to maintain and modify someone else's code.

The previous programmer used a config file to load parameters for a
database connect string. The file is named app.config and it's in the
project and under VSS source control. I'd like to rename the file to
something more appropriate.

I can't find any reference to that filename in the project, and I don't
know when or how the data gets loaded. I'd like someone to illuminate
that for me please.

I'd also like to know how to rename the file and still have it work.

Thanks.
Nov 17 '05 #1
3 1939
Hi,

I think you better check the docs for the configurations settings in .NET

an app.config is the name of the config file managed by the framework, You
add it in VS and it's included in the project files.

The reason you do not see it being used nowhere is cause the framework is
the one reading and parsing it, when you use
System.Configuration.ConfigurationSettings.AppSett ings["Interval"] you are
using that file
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dave Cullen" <no****@mail.com> wrote in message
news:43***************@mail.com...
I'm a C# noob trying to maintain and modify someone else's code.

The previous programmer used a config file to load parameters for a
database connect string. The file is named app.config and it's in the
project and under VSS source control. I'd like to rename the file to
something more appropriate.

I can't find any reference to that filename in the project, and I don't
know when or how the data gets loaded. I'd like someone to illuminate
that for me please.

I'd also like to know how to rename the file and still have it work.

Thanks.

Nov 17 '05 #2
"Dave Cullen" <no****@mail.com> wrote in message
news:43***************@mail.com...
I'm a C# noob trying to maintain and modify someone else's code.

The previous programmer used a config file to load parameters for a
database connect string. The file is named app.config and it's in the
project and under VSS source control. I'd like to rename the file to
something more appropriate.
You don't want to rename that file. app.config is a special name that
Visual Studio looks for. When you build, Visual Studio will copy app.config
to the build output dirtectory and rename it to YourAppName.exe.config.

I can't find any reference to that filename in the project, and I don't
know when or how the data gets loaded. I'd like someone to illuminate
that for me please.

I'd also like to know how to rename the file and still have it work.


If you rename it, it won't work.

Nov 17 '05 #3
Yeah, I found that out after I built the project. There is now a config
file named the same as my exe. Thanks.
John Vottero wrote:

"Dave Cullen" <no****@mail.com> wrote in message
news:43***************@mail.com...
I'm a C# noob trying to maintain and modify someone else's code.

The previous programmer used a config file to load parameters for a
database connect string. The file is named app.config and it's in the
project and under VSS source control. I'd like to rename the file to
something more appropriate.


You don't want to rename that file. app.config is a special name that
Visual Studio looks for. When you build, Visual Studio will copy app.config
to the build output dirtectory and rename it to YourAppName.exe.config.

I can't find any reference to that filename in the project, and I don't
know when or how the data gets loaded. I'd like someone to illuminate
that for me please.

I'd also like to know how to rename the file and still have it work.


If you rename it, it won't work.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Babu | last post by:
Hi, I have an application that maintains its configuration file. This file is read frequently but written to very rarely. There may be several processes attempting to read and write to the config...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
2
by: Frank Chapman | last post by:
I fully admit to being a true nubie, so be kind. I've somehow screwed up my IIS 5.1 after installing ASP 2.0.50215 and testing some basic ASP pages. I receive a Forbidden message which appears...
16
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how...
0
by: Matthew | last post by:
I have created two configurations. One is called Release-Internal and one is called Release-External. I also have two config files named Internal.config and External.config. The difference in the...
0
by: hazz | last post by:
I want to load Service.exe.config into a DataGrid, change the timer interval value from 10000 to 555555, then update the original exe.config. The code below shows the code at step 1 and 2 before...
1
by: Abhi | last post by:
I am using Cryptography application block and am trying to use configSource attribute to keep the config file as separate file. my Application configuration file has following entry ...
6
by: TS | last post by:
I cannot get this to work. I added an app.config to a project i reference from my web application project (vs 05) but can see no way to access the settings within it. the other thing is that I...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.