Moving file to the output directory
-
I have a .config file that must reside in the same directory as the application. How do I make move to the output directory each time a build is performed?
-
I have a .config file that must reside in the same directory as the application. How do I make move to the output directory each time a build is performed?
If its named app.config (for windows and console applications) and resides in the root of your project, VS.NET will do this for you automatically (and rename it to the name of your executable). Otherwise if you have another .config file (say foo.config) you can set the Build Action (right click on the file and select Properties from within VS) to content. I'm pretty sure then that VS will copy the file to the output directory when it performs its build. HIH Andy
-
If its named app.config (for windows and console applications) and resides in the root of your project, VS.NET will do this for you automatically (and rename it to the name of your executable). Otherwise if you have another .config file (say foo.config) you can set the Build Action (right click on the file and select Properties from within VS) to content. I'm pretty sure then that VS will copy the file to the output directory when it performs its build. HIH Andy
Andy Davey wrote: If its named app.config (for windows and console applications) and resides in the root of your project, VS.NET will do this for you automatically (and rename it to the name of your executable). Didn't know that ! Tx. Andy Davey wrote: Otherwise if you have another .config file (say foo.config) you can set the Build Action (right click on the file and select Properties from within VS) to content. I'm pretty sure then that VS will copy the file to the output directory when it performs its build. Already tried that, and it didn't work.