473,386 Members | 1,764 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.

Disappearing config file

Whenever I try to start my service application, the config file is
erased and I get an application exception trying to read it. When I
make it read only, everything is fine.

Anyone know why this erasing happens in the bin\debug directory?

Thanks.

Adam Smith
Nov 15 '05 #1
4 1386
Adam Smith wrote:
Whenever I try to start my service application, the config file is
erased and I get an application exception trying to read it. When I
make it read only, everything is fine.

Anyone know why this erasing happens in the bin\debug directory?

Thanks.

Adam Smith


If you're using VS.NET 2003, it's probably erasing the config file with
each build.

Add a file to your project called "App.config" and place your config
contents in there.

VS.NET will copy that file to the build directory and rename it
appropriately.

--
mikeb
Nov 15 '05 #2
>Whenever I try to start my service application, the config file is
erased and I get an application exception trying to read it. When I
make it read only, everything is fine.
Anyone know why this erasing happens in the bin\debug directory?


Because it was designed to do this?

What did you call your config file? Did you add it to your VS.NET
project?

The trick is to add a text file called "app.config" - exactly that, no
replacements or changes to the name!!!!! - and then VS.NET will always
rename it to <yourapp.exe.config> and place it in your output bin
directory for you.

VS.NET 2003 even has a "Add New Item > Utility > Application
configuration file" menu item, which does exactly that - add a text
file called "app.config" to your current project.

Marc

================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 15 '05 #3
Where do I originally place this "app.config" file, and do I substitute
my application name in the "app" part?

Thanks.

Adam Smith
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #4
Just right-click your project, select Add | Add New Item... Look through to
the bottom of the list shown, you'll see "Application Configuration File".
Choose it, and leave it named as "app.config" (not your application name).

When you do a build, vs.net will rename it to yourapp.exe.config, and copy
it to the output directory.

"Adam Smith" <ad*********@hotmail.com> wrote in message
news:OX**************@tk2msftngp13.phx.gbl...
Where do I originally place this "app.config" file, and do I substitute
my application name in the "app" part?

Thanks.

Adam Smith
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #5

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

Similar topics

9
by: Larry Woods | last post by:
I have a site that works fine for days, then suddenly, I start getting ASP 0115 errors with an indication that session variables IN SEPARATE SESSIONS have disappeared! First, for background...
3
by: baylor | last post by:
I'm having a weird bug and wondering if anyone has ever seen this before A Hello World GUI app. Create an app.config. When you build, Studio copies app.config to bin\debug\ and renames it to the...
3
by: baylor | last post by:
I'm having a weird bug and wondering if anyone has ever seen this before A Hello World GUI app. Create an app.config. When you build, Studio copies app.config to bin\debug\ and renames it to the...
15
by: Mark Rae | last post by:
Hi, I'm presently converting a v1.1 ASP.NET app to v2, and am encountering a strange problem. When running in Debug mode (i.e. hitting F5), all is well. However, when running without...
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: 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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.