Do Config files provide an <include directive ??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I'd like to do is have my individual .DLLs have their own App.config file tha
gets copied into the bin direrctory as MyDLL.dll.config and then in the App.confi
have an <include file="MyDLL.dll.config"> directive to pull in the additional configuratio
data

I know I'm not going to get a MyDLL.dll.config because .NET does not support that
but is there an include directive for the App.config so I can at least copy the file
by hand and get them into the configuration setting class at run time w/o havin
to actually copy the setting into App.config ??
 
Nothing like asking and answering your own question

I'm still not sure if the full funtionality I want will ever be supported by Microsoft (i.e. MyDLL.dll.config automaticall
copied into place along with the .dll or even better, the whole act of adding a reference to a dll will add the appropriat
element to the referencers .config), but the basic functionality I was looking for is available

MyDLL.dll.config
<?xml version "1.0" encoding="utf-8" ?><appSettings><add key="MyKey" value="MyValue" ></appSettings

App.config or Web.config
<?xml version "1.0" encoding="utf-8" ?><configuration><appSettings file="MyDLL.dll.config" /><appSettings
. . .
</appSettings

. . .
 
I lied, it does not work that easy :*( you cannot have two appSettings elements under <configuration> :*
oh well, back to the drawing board . .

----- lester wrote: ----

Nothing like asking and answering your own question

I'm still not sure if the full funtionality I want will ever be supported by Microsoft (i.e. MyDLL.dll.config automaticall
copied into place along with the .dll or even better, the whole act of adding a reference to a dll will add the appropriat
element to the referencers .config), but the basic functionality I was looking for is available

MyDLL.dll.config
<?xml version "1.0" encoding="utf-8" ?><appSettings><add key="MyKey" value="MyValue" ></appSettings

App.config or Web.config
<?xml version "1.0" encoding="utf-8" ?><configuration><appSettings file="MyDLL.dll.config" /><appSettings
. . .
</appSettings

. . .
 
Back
Top