关于自定义配置节,无法识别
在配置中的代码为
<configSections><section name="customProvider" type="DatabaseProvider.HiSection,DatabaseProvider"/> </sectionGroup> </configSections> <customProvider defaultProvider="SqlHiProvider"> <providers> <add name="SqlHiProvider" type="DataBaseProvider.SqlArticleProvider,DatabaseProvider"></add> </providers> </customProvider>
namespace DatabaseProvider{ public class HiSection : ConfigurationSection { /// <summary> /// A collection of registered providers. /// </summary> [ConfigurationProperty("providers")] public ProviderSettingsCollection Providers { get { return (ProviderSettingsCollection)base["providers"]; } } [StringValidator(MinLength = 1)] [ConfigurationProperty("defaultProvider", DefaultValue = "SqlHiProvider")] public string DefaultProvider { get { return (string)base["defaultProvider"]; } set { base["defaultProvider"] = value; } } }}