Troubles with configuration files for application with severalseveral dll

  • Thread starter Thread starter bz
  • Start date Start date
B

bz

Hi,

I have an application that consists in one main exe and several dll's
(BL, DAL, Util, etc)
Each dll project has its own settings (in Properties\Settings.settings
file).
When I build the solution, in the bin folder of each project it VS
generates the mylib.dll and mylib.dll.config files
However, the config files are not copied over to the exe bin filder.
There I only see myapp.exe and myapp.exe.config, and mylib1.dll and
mylib2.dll, and no mylib1.dll.config and mylib2.dll.config

Am I doing something wrong? I thought the dll config's should be
copied there too, since for example if I want to test the app from
there, the dll's need the config files, isn't it?
Do I have to copy the configs manually?

Thanks
 
I believe that an application has only one config file. All loaded
Assemblies use the config file of the application (by default).
 
You'll need a post build event...on non app.config type files.

This is a good helper article:
http://www.eggheadcafe.com/tutorial...180-c1f564b41f85/some-aspnet-20-configur.aspx

As one example (this will make sense after you read the article)

I have to setup a post build event on my "ExternalConnectionStrings.config"
file, when I do anything type of project outside of a web app.
(The web app doesn't run from some /bin/ directory, thus a post build event
isn't needed).

But Peter's very good article should show you some options.
 
Back
Top