views:

775

answers:

2

When I have one app.config in my main project I always have to duplicate it to its test project. How to avoid it?

Update I also asked a very similar, and slightly complicated question

+6  A: 

Add it as a link from a single place. Choose one of the projects as the one with the real app.config and link it to the other projects.

Add -> Existing Item -> Navigate to config file -> add as link (the down arrow in the Add button)

Otávio Décio
It worked! Thanks
Jader Dias
+2  A: 

You can always set up the configuration file using a series of smaller configuration files, and then point both application configuration files to these smaller files using the various configSource attributes provided for you in the configuration system. This will allow you to modularize your configuration, as well as create a common location.

appSettings will allow you to add a "file" attribute that will allow you to offload your application settings onto another file completely.

David Morton