Custom SettingsProvider class
Am using VS.Net 2005 beta 2 and trying to implement a custom SettingsProvider class. Have implemented the methods ApplicationName, Name, GetPropertyValues, SetPropertyValues and Initialize, but when I decorate the Settings class with the custom provider the first call to retrieve one of the settings throws a ConfigurationErrorsException indicating "Failed to load provider type: CustomProvider".
Are custom SettingsProviders supported in beta 2 with C#? If so, any hints or links for implementing them would be appreciated.
Thanks in advance...
You need to provide an assembly qualified type name to the attribute, something like:
[SettingsProvider("MyCustomSettingsProvider, MyAssembly, Version=1.0.0.0...")]
(replace ... with full assembly information)
Alternately, it is easier to use the other overload that takes a type:
[SettingsProvider(typeof(MyCustomSettingsProvider)]
You can also provide it as
[SettingsProvider("MyCustomSettingsProvider.CustomSettingsProvider", "MyCustomSettingsProvider")]
[SettingsProvider("MyCustomSettingsProvider, MyAssembly, Version=1.0.0.0...")]
(replace ... with full assembly information)
Alternately, it is easier to use the other overload that takes a type:
[SettingsProvider(typeof(MyCustomSettingsProvider)]
You can also provide it as
[SettingsProvider("MyCustomSettingsProvider.CustomSettingsProvider", "MyCustomSettingsProvider")]