Custom SettingsProviders

Custom SettingsProviders

am 19.11.2007 17:25:03 von kahlin

Hello,

I am trying to create a custom SettingsProvider that works with the standard
configuration sections that are provided by .NET. What I'm trying to achieve
is that when the application starts, it should go to a centralized location
(which is NOT a UNC drive) and download the settings.

This is easy if I create a new class that inherits from
ApplicationSettingsBase and decorate it with the SettingsProviderAttribute. I
then let my custom SettingsProvider go to a web service (or something
similar) and download the configuration.

However, suppose I want to do the same for the system.diagnostics
configuration section (or any other config section in .NET that I don't have
the source for)? I can't decorate the class with an attribute since it is a
part of the base class library.

Essentially, what I want to do is to replace the default
LocalFileSettingsProvider for many configuration sections available in the
base class library with a SettingsProvider that I have created. Does anyone
have any ideas how I can implement this? Is it even possible?