<configuration>
  <configSections>
    <section name="test" type="System.Web.Configuration.HttpConfigurationContext" />

解决方案 »

  1.   

    <appSettings>
    <add name="test" type="System.Web.Configuration.DictionarySectionHandler" />
    </appSettings>
      

  2.   

    如果你要定义自己的节请按照
    <configuration>
      <configSections>
        <section name="test" type="" />           <------ 定义节是section
      </configSections>  <test>
        <add ... />                               <------ 节内添加项目是add
      </test>...
    </configuration>appSettings是默认的配置节
      

  3.   

    <configSections>
        <add name="test" type="System.Web.Configuration.HttpConfigurationContext"/>
      </configSections>===========>>>
     <appSettings>
        <add name="test" type="System.Web.Configuration.HttpConfigurationContext"/>
     </appSettings>or  <appSettings>
        <add key="mytestkey" value="My first configuration"/>
     </appSettings>
      

  4.   

    改成
      <configSections>
        <section name="test" type="System.Web.Configuration.HttpConfigurationContext" />
      </configSections>
    错误消息:
    配置错误 
    说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。 分析器错误信息: 未找到类型 System.Web.Configuration.HttpConfigurationContext 上的构造函数。源错误: 
    行 4:  
    行 5:    <configSections>
    行 6:      <section name="test" type="System.Web.Configuration.HttpConfigurationContext" />
    行 7:    </configSections>
    行 8:  
     源文件: E:\Inetpub\wwwroot\mpc\asp.net完全入门\web.config    行: 6
      

  5.   

    改成
      <appSettings>
        <add name="test" type="System.Web.Configuration.HttpConfigurationContext" />
      </appSettings>错误消息:
    配置错误 
    说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。 分析器错误信息: 无法识别的元素源错误: 
    行 5:    <appSettings>
    行 6:      <add name="test" type="System.Web.Configuration.HttpConfigurationContext" />
    行 7:    </appSettings>
    行 8:  
    行 9:    ' <test>
     源文件: E:\Inetpub\wwwroot\mpc\asp.net完全入门\web.config    行: 7
      

  6.   

    用这个呢<appSettings>
        <add key="mytestkey" value="My first configuration"/>
    </appSettings>
      

  7.   

    只用这个吗?
    <configuration>
    <appSettings>
        <add key="mytestkey" value="My first configuration"/>
    </appSettings>
    </configuration>那在aspx页里要怎么提取?
      

  8.   

    你可以添加很多个
    <appSettings>
        <add key="key2" value="value1"/>
        <add key="key2" value="value2"/>
         .....
    </appSettings>取值的时候
    string myStr = System.Configuration.ConfigurationSettings.AppSettings["key_name"];