Working with settings files in library dll's as well as app dll's?  
Author Message
Felan





PostPosted: Visual C# General, Working with settings files in library dll's as well as app dll's? Top

My question is about settings files.

In my current most active project I have a library that handles all the data access for a sql server, a web service, and active directory. I use the Settings.settings file to store much of the settings of the library. I have an ASP.NET page that makes calls to this library dll and I have a windows service that also makes calls to the library dll (each with their own copy of the dll).

The only qualm I have is that the settings file gets compiled into the dll so in order to change them I need to recompile. I was wondering if there is a way to keep the settings file seperate from the dll or to merge or override the settings from the settings file of the project that includes the library

Thanks,

Todd



Visual C#15  
 
 
boban.s





PostPosted: Visual C# General, Working with settings files in library dll's as well as app dll's? Top

I use xml settings files. I create a schema (xsd) typed dataset where i add all the library properties. When initializing library class instance, i load settings xml file in typed dataset and get properties in typed manner, just like from settings. You can change the settings file manualy in notepad. Also i have configuration form for every library with settings that i can confugure in runtime if neccessary. This is especially neccessary for DB library because of changing database connection properties.