Jader Dias
Jader Dias

Reputation: 90593

How to avoid duplicate app.config using Visual Studio 2008 unit testing?

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

Upvotes: 3

Views: 1360

Answers (2)

David Morton
David Morton

Reputation: 16505

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.

Upvotes: 2

Otávio Décio
Otávio Décio

Reputation: 74300

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)

Upvotes: 7

Related Questions