Simple question with config file

G

Guest

Dear all,

I am developing a multi tiers application and actually responsible of
delivering the buines logic library.
That buisnes logic library will need some parameters to be suitebale
configured. As a testing purpose I have build a client application which
contains app.config files with paramters for this libary. Everything works as
expected.

Now the question is that I do not want to place library parmeters with the
UI application because I would like to deliver the buislness logic and it's
configuration as a set.

The question I have is , is it possible to get a configuration file attached
to a libray ?
Example :
library name could be : myLib.dll
config file could be : myLib.dll.config

If this is possible how to located the config file at the place the libary
will be loaded ?

Thanks for help
regards
serge
 
A

Andrew Christiansen

The file location of the running assembly can be retrieved using reflection.
This VB.NET code will get the file location of the currently running
assembly:

System.Reflection.GetExecutingAssembly.Location

Then, you can concatenate ".config" to the end.

Hope this helps,
Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top