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

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
Back
Top