ConfigurationManager.GetSection возвращает null

Вот мой app.config

<configuration>
  <configSections>
      <section name="procedureList" type="System.Configuration.NameValueSectionHandler, System, Version=4.0.30319, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
  </configSections>

  <procedureList>
    <add key="NAS.spBusObjGetLineProd" value="@area='Melt Shop';@endDt=?date?;@dayonly=1;@obj='Melt Shop Business Objective" />
    <add key="NAS.spBusObjGetLineProd" value="@area='Cold Mill';@endDt=?date?;@dayonly=1;@obj='Cold Mill Business Objective" /> 
  </procedureList>
  <appSettings>
    <add key="Connstr" value=""/>
    <add key="Userid" value=""/>
    <add key="Timeout" value=""/>
  </appSettings>

</configuration>

Но когда я вызываю это в коде, я получаю обратно ноль

public void samplemethod()
{
    NameValueCollection nvc = ConfigurationManager.GetSection("procedureList") as NameValueCollection;
    string[] keys = nvc.AllKeys;
}

Я был бы признателен за любую помощь, указывающую на то, что я сделал неправильно

13
задан edepperson 8 August 2012 в 21:04
поделиться