Unhandled Exception: System.Configuration.ConfigurationException: Could not create System Configuration.NameValueSectionHandler, System 
Author Message
 Unhandled Exception: System.Configuration.ConfigurationException: Could not create System Configuration.NameValueSectionHandler, System

Hi,All:
    I got an exception:
    Unhandled Exception: System.Configuration.ConfigurationException: Could
not create System     Configuration.NameValueSectionHandler, System
when reading my configuration file

Any ideas?
Thanks in Advance
John

using System;
using System.Configuration ;
using System.Collections.Specialized ;
class Test
{
    public static void Main()
    {
         {

     NameValueCollection d =

(NameValueCollection)ConfigurationSettings.GetConfig("MyGroup/bshEmail");
  if (d!=null) {
      foreach(String key in d )
   Console.WriteLine(d[key]);
  }
  else
   Console.WriteLine("N/A");

        }
    }

Quote:
}

Config File.
<configuration>
   <configSections>
  <sectionGroup name="MyGroup">
     <section name="bshEmail"
type="System.Configuration.NameValueSectionHandler, System"/>
  </sectionGroup>
   </configSections>
   <MyGroup>
   <bshEmail>
 <add key="mailServer" value="mail.aperto.de" />
   </bshEmail>
   </MyGroup>
  <appSettings>
    <add key="pubs" value="server=(local);database=pubs;user id=sa;pwd=" />
    <add key="pubs1" value="1server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs2" value="2server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs3" value="3server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs4" value="4server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs5" value="5server=(local);database=pubs;user id=sa;pwd="
/>
    <add key="pubs6" value="6server=(local);database=pubs;user id=sa;pwd="
/>
  </appSettings>
</configuration>


Mon, 27 Sep 2004 00:20:09 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Unhandled exception System.TypeLoadException

2. System.Drawing.SafeNativeMethods threw an exception

3. System.ExecutionEngineException exception

4. An unhandled exception of type 'System.Configuration.ConfigurationException'

5. Unhandled Exception: System.Security.SecurityException: Security error.

6. ? HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_

7. System.Runtime.InteropServices.VTableCallsNotSupportedException

8. resources.GetObject("imageList1.ImageStream") throws System.Reflection.TargetInvocationException

9. HELP - recieve exception because system critical section was not init

10. HELP - recieve exception because system critical section was not init

11. Could not load type System.Web.Configuration.NameValueSectionHandler...

12. bufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbufferoverrunbuf

 

 
Powered by phpBB® Forum Software