Enterprise library connection when dll app created.

M

Metehanma

I am creating Library (dll) with visual studio. Not windows, console,
or aspnet application, just a library(dll). Later i will use this dll
with my application.
When windows app or aspnet app, Use app.config or web.config to put
connection config files.
When i do dll app where would i put my configuration of connectons..?

i hope i clear.
 
M

Misbah Arefin

dll's are loaded into the application domain of the referencing application
i.e. either a windows app or a web app and hence make use of the applications
config file. The library's config file must be merged by hand into the app's
config file for the dll to read connectionstring etc from this config file.
However there are ways / hacks into making a dll use its own config file
instead of the application config file. This involes dynamically creating an
application domain and specifying the dll.config file for this AppDomain. The
problem with this approach however is that to access any type in the library
from the current domain you'll have to use .NET remoting to get across the
AppDomain boundary.

Besides it is less of an effort than requiring the users of the library to
write special code to load the library into another app domain, create types
in the other app domain and then use .NET remoting to access those objects.
 

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