Note that there are some explanatory texts on larger screens.

plurals
  1. POIf an ASP.NET application uses many DLLs, what's the best approach for keeping configurations of each dll separate?
    primarykey
    data
    text
    <p>After creating settings for each <code>dll</code>, a <code>.dll.config</code> file is generated. If that <code>dll</code> be part of an asp.net application, how to keep this configurations separate for each <code>dll</code> and don't merge them into <code>web.config</code> ?</p> <p>Example: I have a GMailSender class library (DLL) which sends email via GMail servers. All you need is an instance of GMailSender, like this:</p> <pre><code>GMailSender gms = new GMailSender(); gms.To = "myfriend@yahoo.com"; gms.Subject = "System.Configuration dilemma"; gms.Body = "Can anyone help me with this question ?"; gms.Send(); </code></pre> <p>Consider <code>GMailSender</code> is inside <code>GMailSender.dll</code> and it's configuration file is <code>GMailSender.dll.config</code> and the username and password of GMail account are inside it.</p> <p>I want this <code>DLL</code> use the config file of itself (both dll and config in the same directory, i.e in <code>Bin</code> folder of an ASP.NET application) or beside a desktop application. This way the GMailSender is independent of who is using him for retrieving it's configurations (current <code>AppDomain</code> who has loaded this <code>DLL</code>).</p> <p>I want this without reconstructing the wheel (no custom configuration classes). I guess its possible with <code>System.Configuration</code> but this namespace is probably the worst designed of .NET !</p> <p>Please don't tell why you designed so that ...</p> <p>This is a <code>plug-in</code> based design and finally <code>MEF</code> do some kind of it now in .NET 4.0, but there's the same problem for <code>Parts</code> configurations. With <code>MEF</code> at least I don't need anymore to argue for <code>plugin-based</code> design advantages.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload