views:

141

answers:

2

We are working on a solution with various projects inside of it, the bulk of which is inside our Domain class library. This project contains a app.config file with various settings. The stripped down structure of the solution looks like this:

Solution
    Domain project
        app.config
    Integration tests project
        app.config
    Unit tests project
        app.config
    Other projects...

When we run our integration tests project (which references the domain project), the app.config for our domain project IS copied across, its just NOT renamed to domain.dll.config like you would expect. Thus our domain settings are NOT being picked up by the when we run our integration tests.

The build action of the domain app.config file = "None" and CopyToOutputDirectory = "Copy Always"

Any ideas of what the cause of this may be?

EDIT:

Ok so how do I hold 1 copy of domain's app.config? So that I don't need to copy it to all the projects it references?

+2  A: 

.config files dont work for dll's. They need to match the startup executable's name.

Update:

I too, would like to find a good solution to this problem. Well .config management in general.

leppie
A: 

I've ended up creating an xml configuration file for the domain, which is copied on build, and is referenced within each of the external project's app.config.

Eg. My integration project's app.config has a setting for:

<add key="domainConfig" value="domain.config" />
jacko