I used an article "Creating a Flexible Configuration Section Handler
"(http://www.15seconds.com/issue/040504.htm). The Console application
works with app.config but with the web.config. The Namespace change and
inserting into a class library are the only differences in the code.
In the web config
<!-- Config section Group and Sections Declaration -->
<configSections >
<section
name="DropDownL istTableSetting s"
type="EC3Librar y.Configuration .XmlConfigurato r,
EC3Library.Conf iguration"/>
</configSections>
<DropDownListTa bleSettings
type="EC3Librar y.Configuration .DropDownListTa bleSettings,
EC3Library.Conf iguration">
<DropDownListTa bles>
<DropDownListTa ble CacheKey = "ItemListAgency " CacheDuration = "100"
DataTextField = "AgencyCode OEC" DataValueField =
"AgencyDivision Seqid" TableName = "AgencyDivision "/>
<DropDownListTa ble CacheKey = "ItemListAgency 1" CacheDuration =
"100" DataTextField = "AgencyCode OEC" DataValueField =
"AgencyDivision Seqid" TableName = "AgencyDivision "/>
<DropDownListTa ble CacheKey = "ItemListAgency 2" CacheDuration =
"100" DataTextField = "AgencyCode OEC" DataValueField =
"AgencyDivision Seqid" TableName = "AgencyDivision "/>
<DropDownListTa ble CacheKey = "ItemListAgency 3" CacheDuration =
"100" DataTextField = "AgencyCode OEC" DataValueField =
"AgencyDivision Seqid" TableName = "AgencyDivision "/>
</DropDownListTab les>
</DropDownListTab leSettings>
The error message when called from a page.
Parser Error Message: Exception creating section handler.
Source Error:
Line 5: <section
Line 6: name="DropDownL istTableSetting s"
Line 7: type="EC3Librar y.Configuration .XmlConfigurato r,
EC3Library.Conf iguration"/>
Line 8: </configSections>
Line 9:
Source File: c:\inetpub\wwwr oot\EC3\web.con fig Line: 7
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'EC3Library.Con figuration' could not be
loaded.
=== Pre-bind state information ===
LOG: DisplayName = EC3Library.Conf iguration
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/EC3
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: EC3Library.Conf iguration