Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

prevent xml config file from being deleted when recompiling?????????

I use xml configuration file:
For example, if the application's name is Test.exe, the configuration file is: Test.exe.config.
The problem is: everytime when rebuild/compile, Test.exe will be renewed, and Test.exe.config will be deleted(this is not desirable. I don't want config file to be deleted).

1.How to keep config file when compiling the project? I am using Visual Studio. Is there a config option that I can switch between delete and not delete?

2.Another question, someone uses App.config as the configuration file name, it works too. What is the difference btn using App.config and Test.exe.config?

0
emeraldtea
Asked:
emeraldtea
1 Solution
 
ptmcompCommented:
Create a file named app.config in the root folder of your project and place the configuration inside there.
Everytime you compile your project it will be named <YourAppName>.exe.config and copied in the bin folder.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now