views:

168

answers:

1

I have a Web Project (VS 2008) that references a bunch of DLLs. The DLLs are built separately, so the project references binaries and not DLL projects. Some of the DLLs have their own app.config, which I want to be copied autmatically to the web project's output directory. Is there any suitable generic way to achieve this?

+1  A: 

You should avoid having an app.config for class library projects. You will need to manually merge the values with those of web.config as this would be used by the web project.

Darin Dimitrov
It just is that way, and I can't change it. My question was how I can copy those .config files the most generic way? I.e. I don't want to maintain this coupling manually for each dll.
You could copy those config files as a post-build step or something but they will never be used by the web application which kind of defeats the whole purpose of them.
Darin Dimitrov
They *will* be used since there is a special implementation to read them. Using the post-build, I will need to maintain it manually for each dll.I'm looking for a more generic way...Like telling msbuild something like 'for every referenced *.dll to be copied if there is *.dll.config then copy it along with the dll'.