app.exe.confg file being deleted when windows application is compi

G

Guest

I just upgraded from the 2002.net to the 2003.net. I had been using a
..config file for database conection info. Now when I compile my application
to debug the config file is being deleted out of the /bin/debug folder. Is
there a fix for this?
 
K

Kevin Thomas

It does this by design (unfortunately). Here's what you do:

In the root of your project you should have (and if you don't, just add) a
file called app.config. Use this file as your master copy. Then when you
compile your program, let's say the exe is called "myProgram.exe", VS will
copy the app.config file to the bin/debug folder and automatically rename
it, "myProgram.exe.config"

Each time you compile it will keep doing this; deleting the existing
myProgram.exe.config file and replacing it with the app.config file from the
root of the project.

Hope this helps,

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top