H2ONaCl
H2ONaCl

Reputation: 11269

how do I ensure that the config file is identical to the vshost.exe config file

This question has been edited after a poster suggested it needed improvement:

This is a Visual Studio behaviour question. If I make config file changes using an XML editor, do I have to edit both the vshost.exe config file and the regular config file to ensure they are always the same?

Upvotes: 1

Views: 865

Answers (3)

Hans Passant
Hans Passant

Reputation: 941545

Project + Add New Item, select "Application Configuration File". Edit that one. The IDE makes sure that it gets copied to the bin\Debug directory and that the vshost version will match.

Upvotes: 2

H2ONaCl
H2ONaCl

Reputation: 11269

I performed the following test.

I edited only the .vshost.exe config file and executed the program in the IDE. After running the program, the two files have the same time stamp so presumably they are the same (although I don't have a binary diff program to prove it and may be functionally identical files would still look different to a binary diff program). It is nice that Visual Studio makes them identical, but the problem is that my edits were lost, that is, the regular config file parameters appear in both config files.

The rule of operation should be: always edit the regular config file.

Upvotes: 0

JP Alioto
JP Alioto

Reputation: 45117

No. The vshost.exe.config file is replaced each time you build. But that said, you should not edit configuration files in the Debug or Release folder. If you edit the app.config in your solution folder and you will be fine. Furthermore, you should not deploy the vshost.exe or the vshost.exe.config as those are used only by the debugger.

Upvotes: 0

Related Questions