关于配置节的问题
下面是帮助文件中的例子,我什么运行出错呢?怎么改呀?
<configSections>
<section name="sampleSection"
type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<sampleSection setting1="Value1" setting2="value two"
setting3="third value" />
///////////////////
using System;
using System.Collections;
using System.Configuration;
class MyConfigurationReader {
public void ReadMySettings() {
IDictionary sampleTable = (IDictionary)
ConfigurationSettings.GetConfig("sampleSection");
string value1 = (string)sampleTable["setting1"];
string value2 = (string)sampleTable["setting2"];
string value3 = (string)sampleTable["setting3"];
}
}
出错信息
Server Error in '/test' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Exception creating section handler.
Source Error:
Line 4: <configSections>
Line 5: <section name="sampleSection"
Line 6: type="System.Configuration.SingleTagSectionHandler" />
Line 7: </configSections>
Line 8:
Source File: C:\Inetpub\wwwroot\test\web.config Line: 6
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573